Browse Source

fix shuffle in order and fill with group mode incompatibility (#2044)

pull/2045/head
Jason Dove 1 month ago committed by GitHub
parent
commit
07cbf9936b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 6
      ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs
  3. 5
      ErsatzTV.Application/ProgramSchedules/Queries/GetProgramScheduleItemsHandler.cs
  4. 7
      ErsatzTV/Pages/ScheduleItemsEditor.razor
  5. 1
      ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs

1
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 multi-variant playlist to report more accurate `BANDWIDTH` value based on ffmpeg profile
- Fix detecting NVIDIA capabilities on Blackwell GPUs - Fix detecting NVIDIA capabilities on Blackwell GPUs
- Fix decoder selection in NVIDIA pipeline - 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 ## [25.1.0] - 2025-01-10
### Added ### Added

6
ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs

@ -99,6 +99,12 @@ public class ReplaceProgramScheduleItemsHandler : ProgramScheduleItemCommandBase
var keyOrders = new Dictionary<CollectionKey, System.Collections.Generic.HashSet<PlaybackOrder>>(); var keyOrders = new Dictionary<CollectionKey, System.Collections.Generic.HashSet<PlaybackOrder>>();
foreach (ReplaceProgramScheduleItem item in request.Items) 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( var key = new CollectionKey(
item.CollectionType, item.CollectionType,
item.CollectionId, item.CollectionId,

5
ErsatzTV.Application/ProgramSchedules/Queries/GetProgramScheduleItemsHandler.cs

@ -72,6 +72,11 @@ public class GetProgramScheduleItemsHandler :
item = item with { PlayoutMode = PlayoutMode.One }; item = item with { PlayoutMode = PlayoutMode.One };
} }
} }
if (item.PlaybackOrder is PlaybackOrder.ShuffleInOrder)
{
item = item with { FillWithGroupMode = FillWithGroupMode.None };
}
} }
return item; return item;

7
ErsatzTV/Pages/ScheduleItemsEditor.razor

@ -282,8 +282,15 @@
</MudGrid> </MudGrid>
<MudSelect Class="mt-3" Label="Fill With Group Mode (Show or Artist)" @bind-Value="@_selectedItem.FillWithGroupMode" For="@(() => _selectedItem.FillWithGroupMode)" Disabled="@(_selectedItem.CanFillWithGroups == false)"> <MudSelect Class="mt-3" Label="Fill With Group Mode (Show or Artist)" @bind-Value="@_selectedItem.FillWithGroupMode" For="@(() => _selectedItem.FillWithGroupMode)" Disabled="@(_selectedItem.CanFillWithGroups == false)">
<MudSelectItem Value="FillWithGroupMode.None">(none)</MudSelectItem> <MudSelectItem Value="FillWithGroupMode.None">(none)</MudSelectItem>
@if (_selectedItem.CanFillWithGroups)
{
<MudSelectItem Value="FillWithGroupMode.FillWithOrderedGroups">Ordered Groups</MudSelectItem> <MudSelectItem Value="FillWithGroupMode.FillWithOrderedGroups">Ordered Groups</MudSelectItem>
<MudSelectItem Value="FillWithGroupMode.FillWithShuffledGroups">Shuffled Groups</MudSelectItem> <MudSelectItem Value="FillWithGroupMode.FillWithShuffledGroups">Shuffled Groups</MudSelectItem>
}
else
{
_selectedItem.FillWithGroupMode = FillWithGroupMode.None;
}
</MudSelect> </MudSelect>
<MudSelect Class="mt-3" Label="Tail Mode" @bind-Value="@_selectedItem.TailMode" For="@(() => _selectedItem.TailMode)" Disabled="@(_selectedItem.PlayoutMode != PlayoutMode.Duration)"> <MudSelect Class="mt-3" Label="Tail Mode" @bind-Value="@_selectedItem.TailMode" For="@(() => _selectedItem.TailMode)" Disabled="@(_selectedItem.PlayoutMode != PlayoutMode.Duration)">
<MudSelectItem Value="@TailMode.None">(none)</MudSelectItem> <MudSelectItem Value="@TailMode.None">(none)</MudSelectItem>

1
ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs

@ -41,6 +41,7 @@ public class ProgramScheduleItemEditViewModel : INotifyPropertyChanged
public bool CanFillWithGroups => public bool CanFillWithGroups =>
PlayoutMode is PlayoutMode.Multiple or PlayoutMode.Duration PlayoutMode is PlayoutMode.Multiple or PlayoutMode.Duration
&& PlaybackOrder is not PlaybackOrder.ShuffleInOrder
&& CollectionType is ProgramScheduleItemCollectionType.Collection && CollectionType is ProgramScheduleItemCollectionType.Collection
or ProgramScheduleItemCollectionType.MultiCollection or ProgramScheduleItemCollectionType.SmartCollection; or ProgramScheduleItemCollectionType.MultiCollection or ProgramScheduleItemCollectionType.SmartCollection;

Loading…
Cancel
Save