From f17151bd20f3551e8100265953b7dd48d51b11d3 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Thu, 22 Jul 2021 11:12:14 -0500 Subject: [PATCH] fix multi-collection bug (#318) --- CHANGELOG.md | 3 +++ ErsatzTV.Core/Scheduling/MultiCollectionGrouper.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6307f1b79..1c45da41b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add multiple local libraries to better organize your media - Add `Move Library Path` function to support reorganizing existing local libraries +### Fixed +- Fix bug preventing playouts from rebuilding after an empty collection is encountered within a multi-collection + ## [0.0.51-alpha] - 2021-07-18 ### Added - Add `Multi Collection` to support shuffling multiple collections within a single schedule item diff --git a/ErsatzTV.Core/Scheduling/MultiCollectionGrouper.cs b/ErsatzTV.Core/Scheduling/MultiCollectionGrouper.cs index c99f403f7..ecbad2399 100644 --- a/ErsatzTV.Core/Scheduling/MultiCollectionGrouper.cs +++ b/ErsatzTV.Core/Scheduling/MultiCollectionGrouper.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; namespace ErsatzTV.Core.Scheduling { @@ -8,7 +9,7 @@ namespace ErsatzTV.Core.Scheduling { var result = new List(); - foreach (CollectionWithItems collection in collections) + foreach (CollectionWithItems collection in collections.Where(collection => collection.MediaItems.Any())) { if (collection.ScheduleAsGroup) {