fix adding items to empty playlists (#1784)

This commit is contained in:
Jason Dove
2024-07-11 12:17:41 -05:00
committed by GitHub
parent a0a047ba18
commit 9dd4a85bf9
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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
@@ -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)
{