Skip to content

Commit

Permalink
fix: epg
Browse files Browse the repository at this point in the history
  • Loading branch information
SenexCrenshaw committed Feb 8, 2024
1 parent 24c0c0a commit d303367
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,5 @@ dist
ffmpeg/ffmpeg
epg.xml
m3u.m3u
ghtoken
ghtoken
Dockerfile
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM docker.io/senexcrenshaw/streammaster:0.9.0-sm AS sm
FROM --platform=$BUILDPLATFORM docker.io/senexcrenshaw/streammaster:0.9.3-sm AS sm
FROM --platform=$BUILDPLATFORM docker.io/senexcrenshaw/streammaster:0.9.0-base AS base
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
Expand Down
15 changes: 10 additions & 5 deletions StreamMaster.Domain/Common/FileUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public static string CleanUpFileName(string fullName)

try
{

XmlSerializer serializer = new(typeof(XMLTV));
using Stream reader = GetFileDataStream(filepath);
using StreamReader reader = GetFileDataStream(filepath);
object? result = serializer.Deserialize(reader);
return (XMLTV?)result;
}
Expand Down Expand Up @@ -228,14 +229,18 @@ public static async Task<string> GetContentType(string Url)



public static Stream GetFileDataStream(string source)
public static StreamReader GetFileDataStream(string source)
{

if (!IsFileGzipped(source))
{
return File.OpenRead(source);
using StreamReader readerf = new(source, Encoding.Default);
return readerf;
}
FileStream fs = File.OpenRead(source);
return new GZipStream(fs, CompressionMode.Decompress);
using FileStream fs = File.OpenRead(source);
using GZipStream gzStream = new(fs, CompressionMode.Decompress);
using StreamReader reader = new(gzStream, Encoding.Default);
return reader;
}

public static async Task<string> GetFileData(string source)
Expand Down
3 changes: 2 additions & 1 deletion build_docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ param (
[switch]$SkipMainBuild = $false,
[string]$BuildBaseVer = '',
[string]$BuildBuildVer = '',
[string]$BuildSMVer = ''
[string]$BuildSMVer = '',
[string]$BuildVer = ''
)

$global:tags
Expand Down

0 comments on commit d303367

Please sign in to comment.