diff --git a/CHANGELOG.md b/CHANGELOG.md index 880e0dc5..596aa806 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix multi-variant playlist to report more accurate `BANDWIDTH` value based on ffmpeg profile - Fix detecting NVIDIA capabilities on Blackwell GPUs - Fix decoder selection in NVIDIA pipeline +- Prevent playback order `Shuffle In Order` from being used with `Fill With Group Mode` as they are incompatible ## [25.1.0] - 2025-01-10 ### Added diff --git a/ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs b/ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs index bcae69d6..8c0c8e2f 100644 --- a/ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs +++ b/ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs @@ -99,6 +99,12 @@ public class ReplaceProgramScheduleItemsHandler : ProgramScheduleItemCommandBase var keyOrders = new Dictionary>(); foreach (ReplaceProgramScheduleItem item in request.Items) { + if (item.PlaybackOrder is PlaybackOrder.ShuffleInOrder && + item.FillWithGroupMode is not FillWithGroupMode.None) + { + return new BaseError("Shuffle in Order cannot be used with Fill With Group Mode"); + } + var key = new CollectionKey( item.CollectionType, item.CollectionId, diff --git a/ErsatzTV.Application/ProgramSchedules/Queries/GetProgramScheduleItemsHandler.cs b/ErsatzTV.Application/ProgramSchedules/Queries/GetProgramScheduleItemsHandler.cs index dd98442b..15e4343c 100644 --- a/ErsatzTV.Application/ProgramSchedules/Queries/GetProgramScheduleItemsHandler.cs +++ b/ErsatzTV.Application/ProgramSchedules/Queries/GetProgramScheduleItemsHandler.cs @@ -72,6 +72,11 @@ public class GetProgramScheduleItemsHandler : item = item with { PlayoutMode = PlayoutMode.One }; } } + + if (item.PlaybackOrder is PlaybackOrder.ShuffleInOrder) + { + item = item with { FillWithGroupMode = FillWithGroupMode.None }; + } } return item; diff --git a/ErsatzTV/Pages/ScheduleItemsEditor.razor b/ErsatzTV/Pages/ScheduleItemsEditor.razor index d14e9a5d..54bc0a7e 100644 --- a/ErsatzTV/Pages/ScheduleItemsEditor.razor +++ b/ErsatzTV/Pages/ScheduleItemsEditor.razor @@ -282,8 +282,15 @@ (none) - Ordered Groups - Shuffled Groups + @if (_selectedItem.CanFillWithGroups) + { + Ordered Groups + Shuffled Groups + } + else + { + _selectedItem.FillWithGroupMode = FillWithGroupMode.None; + } (none) diff --git a/ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs b/ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs index 28e889fc..624af3d0 100644 --- a/ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs +++ b/ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs @@ -41,6 +41,7 @@ public class ProgramScheduleItemEditViewModel : INotifyPropertyChanged public bool CanFillWithGroups => PlayoutMode is PlayoutMode.Multiple or PlayoutMode.Duration + && PlaybackOrder is not PlaybackOrder.ShuffleInOrder && CollectionType is ProgramScheduleItemCollectionType.Collection or ProgramScheduleItemCollectionType.MultiCollection or ProgramScheduleItemCollectionType.SmartCollection;