fix multi collection editor id collision (#1644)
This commit is contained in:
@@ -47,6 +47,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Fix VAAPI transcoding of OTA content containing A53 CC data
|
||||
- Fix AV1 software decoder priority (`libdav1d`, `libaom-av1`, `av1`)
|
||||
- Fix some stream failures caused by loudnorm filter
|
||||
- Fix multi-collection editor improperly disabling collections/smart collections that haven't already been added to the multi-collection
|
||||
|
||||
### Changed
|
||||
- Log search index updates under scanner category at debug level, to indicate a potential cause for the UI being out of date
|
||||
|
||||
@@ -5,7 +5,12 @@ namespace ErsatzTV.Application.MediaCollections;
|
||||
internal static class Mapper
|
||||
{
|
||||
internal static MediaCollectionViewModel ProjectToViewModel(Collection collection) =>
|
||||
new(collection.Id, collection.Name, collection.UseCustomPlaybackOrder, MediaItemState.Normal);
|
||||
new(
|
||||
ProgramScheduleItemCollectionType.Collection,
|
||||
collection.Id,
|
||||
collection.Name,
|
||||
collection.UseCustomPlaybackOrder,
|
||||
MediaItemState.Normal);
|
||||
|
||||
internal static MultiCollectionViewModel ProjectToViewModel(MultiCollection multiCollection) =>
|
||||
new(
|
||||
|
||||
@@ -4,6 +4,7 @@ using ErsatzTV.Core.Domain;
|
||||
namespace ErsatzTV.Application.MediaCollections;
|
||||
|
||||
public record MediaCollectionViewModel(
|
||||
ProgramScheduleItemCollectionType CollectionType,
|
||||
int Id,
|
||||
string Name,
|
||||
bool UseCustomPlaybackOrder,
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
HelperText="Disabled collections are already present in this multi collection">
|
||||
@foreach (MediaCollectionViewModel collection in _collections)
|
||||
{
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.Id == collection.Id))"
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.CollectionType == collection.CollectionType && i.Collection.Id == collection.Id))"
|
||||
Value="@collection">
|
||||
@collection.Name
|
||||
</MudSelectItem>
|
||||
@@ -43,7 +43,7 @@
|
||||
HelperText="Disabled collections are already present in this multi collection">
|
||||
@foreach (SmartCollectionViewModel collection in _smartCollections)
|
||||
{
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.Id == collection.Id))"
|
||||
<MudSelectItem Disabled="@(_model.Items.Any(i => i.Collection.CollectionType == ProgramScheduleItemCollectionType.SmartCollection && i.Collection.Id == collection.Id))"
|
||||
Value="@collection">
|
||||
@collection.Name
|
||||
</MudSelectItem>
|
||||
|
||||
@@ -55,7 +55,13 @@
|
||||
[Parameter]
|
||||
public string DetailHighlight { get; set; }
|
||||
|
||||
private readonly MediaCollectionViewModel _newCollection = new(-1, "(New Collection)", false, MediaItemState.Normal);
|
||||
private readonly MediaCollectionViewModel _newCollection = new(
|
||||
ProgramScheduleItemCollectionType.Collection,
|
||||
-1,
|
||||
"(New Collection)",
|
||||
false,
|
||||
MediaItemState.Normal);
|
||||
|
||||
private string _newCollectionName;
|
||||
|
||||
private List<MediaCollectionViewModel> _collections = new();
|
||||
|
||||
@@ -15,6 +15,7 @@ public class MultiCollectionSmartItemEditViewModel : MultiCollectionItemEditView
|
||||
_smartCollection = value;
|
||||
|
||||
Collection = new MediaCollectionViewModel(
|
||||
ProgramScheduleItemCollectionType.SmartCollection,
|
||||
_smartCollection.Id,
|
||||
_smartCollection.Name,
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user