Skip to content

Commit

Permalink
fix: Bug: Schedules Direct EPG data download triggers a failure in SM #…
Browse files Browse the repository at this point in the history
  • Loading branch information
SenexCrenshaw committed Nov 15, 2024
1 parent f595453 commit ce0811e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions StreamMaster.SchedulesDirect/Images/SeasonImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ private void ProcessCachedImages(Season season, EPGJsonCache cache)
if (artwork != null)
{
season.extras.AddOrUpdate("artwork", artwork);
season.mxfGuideImage = epgCache.GetGuideImageAndUpdateCache(artwork, ImageType.Season);
MxfGuideImage? mx = epgCache.GetGuideImageAndUpdateCache(artwork, ImageType.Season);
if (mx != null)
{
season.mxfGuideImage = mx;
}
}
}

Expand Down Expand Up @@ -146,8 +150,11 @@ private void ProcessSeasonImageResponses()
}

List<ProgramArtwork> artwork = season.extras.ContainsKey("artwork")
? season.extras["artwork"].Concat(SDHelpers.GetTieredImages(response.Data, ["season"], artworkSize)).ToList()
: SDHelpers.GetTieredImages(response.Data, ["season"], artworkSize);
? season.extras["artwork"]
.Concat(SDHelpers.GetTieredImages(response.Data, ["season"], artworkSize))
.ToList() // Ensure you convert the IEnumerable to List.
: SDHelpers.GetTieredImages(response.Data, ["season"], artworkSize);


season.extras["artwork"] = artwork;
string uid = $"{season.SeriesId}_{season.SeasonNumber}";
Expand All @@ -156,7 +163,11 @@ private void ProcessSeasonImageResponses()
epgCache.AddAsset(uid, null);
}

season.mxfGuideImage = epgCache.GetGuideImageAndUpdateCache(artwork, ImageType.Season, uid);
MxfGuideImage? mx = epgCache.GetGuideImageAndUpdateCache(artwork, ImageType.Season, uid);
if (mx != null)
{
season.mxfGuideImage = mx;
}
}
}

Expand Down

0 comments on commit ce0811e

Please sign in to comment.