Browse Source

fix adding items to empty playlists (#1784)

pull/1787/head
Jason Dove 1 year ago committed by GitHub
parent
commit
9dd4a85bf9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      ErsatzTV.Application/MediaCollections/Commands/AddItemsToPlaylistHandler.cs

1
CHANGELOG.md

@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add basic cache busting to XMLTV image URLs
- This should help with clients not showing correct channel logos or posters
- Fix artwork in other video libraries by @raknam
- Fix adding items to empty playlists
### Changed
- Remove some unnecessary API calls related to media server scanning and paging

2
ErsatzTV.Application/MediaCollections/Commands/AddItemsToPlaylistHandler.cs

@ -48,7 +48,7 @@ public class AddItemsToPlaylistHandler : IRequestHandler<AddItemsToPlaylist, Eit @@ -48,7 +48,7 @@ public class AddItemsToPlaylistHandler : IRequestHandler<AddItemsToPlaylist, Eit
{ ProgramScheduleItemCollectionType.Image, request.ImageIds }
};
int index = playlist.Items.Max(i => i.Index) + 1;
int index = playlist.Items.Count > 0 ? playlist.Items.Max(i => i.Index) + 1 : 0;
foreach ((ProgramScheduleItemCollectionType collectionType, List<int> ids) in allItems)
{

Loading…
Cancel
Save