The Free Software Media System - Server Backend & API
Apply review suggestion
Shadowghostd63b2b265776
diff --git a/src/Jellyfin.LiveTv/Guide/GuideManager.cs b/src/Jellyfin.LiveTv/Guide/GuideManager.csindex 7e1992baf2..47aa31c0f6 100644--- a/src/Jellyfin.LiveTv/Guide/GuideManager.cs+++ b/src/Jellyfin.LiveTv/Guide/GuideManager.cs@@ -742,9 +742,13 @@ public class GuideManager : IGuideManagerprivate async Task PreCacheImages(IReadOnlyList<BaseItem> programs, DateTime maxCacheDate){+ var sdLimitActive = IsSdImageLimitActive();+await Parallel.ForEachAsync(programs.Where(p => p.EndDate.HasValue && p.EndDate.Value < maxCacheDate)+ .Where(p => !sdLimitActive || !p.ImageInfos.All(+ img => img.IsLocalFile || img.Path.Contains("schedulesdirect", StringComparison.OrdinalIgnoreCase))).DistinctBy(p => p.Id),_cacheParallelOptions,async (program, cancellationToken) =>