Skip to content

Commit

Permalink
defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
SenexCrenshaw committed Oct 24, 2024
1 parent 1c3ef0b commit 84011f5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 58 deletions.
26 changes: 11 additions & 15 deletions Dockerfile.sm.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,35 @@ WORKDIR /src
# Copy all files into the image
COPY . .

# Run dotnet restore and npm install in parallel
# RUN (dotnet restore "StreamMaster.API/StreamMaster.API.csproj" -a $TARGETARCH && \
# dotnet build "StreamMaster.API.csproj" -c Debug -o /app/build -a $TARGETARCH) & \
# (cd /src/streammasterwebui && npm install && npm run build && \
# cp -r dist/* /src/StreamMaster.API/wwwroot/) && wait

# Step 1: Restore and build the .NET project
# Step 1: Restore and build the .NET project with error-only output but keep echo messages
RUN echo "Starting .NET restore..." && \
dotnet restore "StreamMaster.API/StreamMaster.API.csproj" -a $TARGETARCH && \
dotnet restore "StreamMaster.API/StreamMaster.API.csproj" -a $TARGETARCH --verbosity m && \
echo ".NET restore completed successfully." || echo "Error during .NET restore!" && \
\
echo "Starting .NET build..." && \
dotnet build "StreamMaster.API.csproj" -c Debug -o /app/build -a $TARGETARCH && \
dotnet build "StreamMaster.API/StreamMaster.API.csproj" -c Debug -o /app/build -a $TARGETARCH --verbosity m && \
echo ".NET build completed successfully." || echo "Error during .NET build!"

# Step 2: Install npm packages, build the frontend, and copy to wwwroot
# Step 2: Install npm packages, build the frontend, and copy to wwwroot with error-only output but keep echo messages
RUN echo "Navigating to frontend directory: /src/streammasterwebui" && \
cd /src/streammasterwebui && \
echo "Installing npm dependencies..." && \
npm install && \
npm install --silent && \
echo "npm install completed successfully." || echo "Error during npm install!" && \
\
echo "Building frontend with npm run build..." && \
npm run build && \
npm run build --silent && \
echo "Frontend build completed successfully." || echo "Error during frontend build!" && \
\
echo "Copying frontend build files to /src/StreamMaster.API/wwwroot/..." && \
cp -r dist/* /src/StreamMaster.API/wwwroot/ && \
echo "Files copied to wwwroot successfully." || echo "Error copying files to wwwroot!"

# Publish the .NET application
# Publish the .NET application with error-only output but keep echo messages
WORKDIR "/src/StreamMaster.API"
RUN dotnet publish --no-restore "StreamMaster.API.csproj" -c Debug -o /app/publish /p:UseAppHost=false -a $TARGETARCH
RUN echo "Publishing .NET application..." && \
dotnet publish --no-restore "StreamMaster.API.csproj" -c Debug -o /app/publish /p:UseAppHost=false -a $TARGETARCH --verbosity m && \
echo ".NET publish completed successfully." || echo "Error during .NET publish!"

# Clean up source files
RUN rm -rf /src
#RUN rm -rf /src
Original file line number Diff line number Diff line change
Expand Up @@ -255,41 +255,5 @@ private static void UpdateProperty<T>(OutputProfile profile, SMChannel smChannel

return (smChannel.ChannelNumber, lines);
}
//private string GetIconUrl(string iconOriginalSource, Setting setting)
//{
// string baseUrl = httpContextAccessor.GetUrl();

// if (string.IsNullOrEmpty(iconOriginalSource))
// {
// return $"{baseUrl}{setting.DefaultLogo}";
// }

// string originalUrl = iconOriginalSource;

// if (iconOriginalSource.StartsWith('/'))
// {
// iconOriginalSource = iconOriginalSource[1..];
// }

// if (iconOriginalSource.StartsWith("images/"))
// {
// return $"{baseUrl}/{iconOriginalSource}";
// }
// else if (!iconOriginalSource.StartsWith("http"))
// {
// return GetApiUrl(SMFileTypes.TvLogo, originalUrl);
// }
// else if (string.Equals(setting.LogoCache, "cache", StringComparison.OrdinalIgnoreCase))
// {
// return GetApiUrl(SMFileTypes.Logo, originalUrl);
// }

// return iconOriginalSource;
//}

//private string GetApiUrl(SMFileTypes path, string source)
//{
// string baseUrl = httpContextAccessor.GetUrl();
// return $"{baseUrl}/api/files/{(int)path}/{WebUtility.UrlEncode(source)}";
//}

}
4 changes: 2 additions & 2 deletions StreamMaster.Domain/Models/M3UFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public M3UFile()
public int MaxStreamCount { get; set; }
public int StreamCount { get; set; }
public bool SyncChannels { get; set; }
public int StartingChannelNumber { get; set; }
public bool AutoSetChannelNumbers { get; set; }
public int StartingChannelNumber { get; set; } = 1;
public bool AutoSetChannelNumbers { get; set; } = true;

//public string? DefaultGroup { get; set; }
public string? DefaultStreamGroupName { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions build_docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ $global:tags
function Main {
Set-EnvironmentVariables

if ( $SkipMainBuild ) {
$Prod = $false
}
# if ( $SkipMainBuild ) {
# $Prod = $false
# }

if (-not $SkipRelease -and -not $PrintCommands) {

Expand Down
3 changes: 2 additions & 1 deletion streammasterwebui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["unused-imports", "html","sort-keys-fix","typescript-sort-keys","react-hooks-addons"],
"plugins": ["import","unused-imports", "html","sort-keys-fix","typescript-sort-keys","react-hooks-addons"],
"ignorePatterns": [ "*.css", "node_modules/", "dist/"],
"rules": {
"import/no-unresolved": ["error", { "caseSensitive": true }],
"react-hooks-addons/no-unused-deps": "warn",
"typescript-sort-keys/interface": "off",
"no-lone-blocks": "off",
Expand Down

0 comments on commit 84011f5

Please sign in to comment.