Skip to content

Commit

Permalink
feat: Add functionality to handle dummy video streams
Browse files Browse the repository at this point in the history
This commit adds functionality to handle dummy video streams in the GetStreamGroupLineUp query. Dummy video streams are now identified and processed separately from regular video streams. Dummy video streams are given a unique ID and added to the dummy data collection. This feature will enhance the user experience by allowing the application to handle dummy video streams effectively.
  • Loading branch information
SenexCrenshaw committed Feb 2, 2024
1 parent 53c7323 commit e666c4d
Showing 1 changed file with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,37 @@ public async Task<string> Handle(GetStreamGroupLineup request, CancellationToken
return JsonSerializer.Serialize(ret);
}

ISchedulesDirectData dummyData = schedulesDirectDataService.DummyData();
foreach (VideoStreamDto videoStream in videoStreams.OrderBy(a => a.User_Tvg_chno))
{
if (setting.M3UIgnoreEmptyEPGID &&
(string.IsNullOrEmpty(videoStream.User_Tvg_ID) || videoStream.User_Tvg_ID.ToLower() == "dummy"))
if (setting.M3UIgnoreEmptyEPGID && string.IsNullOrEmpty(videoStream.User_Tvg_ID))
{
continue;
}

//string videoUrl = videoStream.Url;
bool isDummy = epgHelper.IsDummy(videoStream.User_Tvg_ID);

if (isDummy)
{
videoStream.User_Tvg_ID = $"{EPGHelper.DummyId}-{videoStream.Id}";
VideoStreamConfig videoStreamConfig = new()
{
Id = videoStream.Id,
M3UFileId = videoStream.M3UFileId,
User_Tvg_name = videoStream.User_Tvg_name,
Tvg_ID = videoStream.Tvg_ID,
User_Tvg_ID = videoStream.User_Tvg_ID,
User_Tvg_Logo = videoStream.User_Tvg_logo,
User_Tvg_chno = videoStream.User_Tvg_chno,
IsDuplicate = false,
IsDummy = false
};
dummyData.FindOrCreateDummyService(videoStream.User_Tvg_ID, videoStreamConfig);
}

int epgNumber = EPGHelper.DummyId;
string stationId;


if (string.IsNullOrEmpty(videoStream.User_Tvg_ID))
{
stationId = videoStream.User_Tvg_group;
Expand Down

0 comments on commit e666c4d

Please sign in to comment.