Apply review suggestion

This commit is contained in:
Shadowghost
2026-02-22 12:37:14 +01:00
parent ed43ad0968
commit d63b2b2657

View File

@@ -742,9 +742,13 @@ public class GuideManager : IGuideManager
private 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) =>