Skip to content

Commit

Permalink
fix: Dummies
Browse files Browse the repository at this point in the history
  • Loading branch information
SenexCrenshaw committed Feb 2, 2024
1 parent 6b2568f commit 08a0d97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
32 changes: 4 additions & 28 deletions StreamMaster.Application/StreamGroups/Queries/GetStreamGroupEPG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,34 +78,10 @@ public async Task<string> Handle(GetStreamGroupEPG request, CancellationToken ca
videoStreamConfig.IsDummy = epgHelper.IsDummy(videoStreamConfig.User_Tvg_ID);

if (videoStreamConfig.IsDummy)
{
// Initialize a variable to hold the service
MxfService? service = null;

// Check if User_Tvg_ID is not empty and assign the corresponding service
if (!string.IsNullOrEmpty(videoStreamConfig.User_Tvg_ID))
{
service = allservices.Find(a => a.StationId.Equals(videoStreamConfig.User_Tvg_ID, StringComparison.CurrentCultureIgnoreCase));
}
// If service is still null and Tvg_ID is not empty, assign the corresponding service
else if (!string.IsNullOrEmpty(videoStreamConfig.Tvg_ID))
{
service = allservices.Find(a => a.StationId.Equals(videoStreamConfig.Tvg_ID, StringComparison.CurrentCultureIgnoreCase));
}

// If a service is found, update User_Tvg_ID accordingly
if (service != null)
{
videoStreamConfig.User_Tvg_ID = $"{service.EPGNumber}-{service.StationId}";
videoStreamConfig.IsDummy = false;
}
else
{

videoStreamConfig.User_Tvg_ID = EPGHelper.DummyId + "-" + videoStreamConfig.Id;

dummyData.FindOrCreateDummyService(videoStreamConfig.Id, videoStreamConfig);
}
{
videoStreamConfig.User_Tvg_ID = $"{EPGHelper.DummyId}-{videoStreamConfig.Id}";

dummyData.FindOrCreateDummyService(videoStreamConfig.User_Tvg_ID, videoStreamConfig);
}

if (epgids.Contains(videoStreamConfig.User_Tvg_ID))
Expand Down
4 changes: 2 additions & 2 deletions StreamMaster.SchedulesDirect/XMLTVBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public class XMLTVBuilder(IMemoryCache memoryCache, IEPGHelper ePGHelper, IIconS

if (origService.EPGNumber == EPGHelper.DummyId && !string.IsNullOrEmpty(videoStreamConfig.Tvg_ID))
{

callSign = videoStreamConfig.Tvg_ID;
(epgNumber, stationId) = ePGHelper.ExtractEPGNumberAndStationId(videoStreamConfig.Tvg_ID);
callSign = stationId;
}

int chNo = videoStreamConfig.User_Tvg_chno;
Expand Down

0 comments on commit 08a0d97

Please sign in to comment.