This commit is contained in:
sir-wilhelm 2026-02-27 22:04:44 -06:00 committed by GitHub
commit 0141fd0aae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 8 deletions

View file

@ -397,9 +397,10 @@ class PlaylistController {
const mediaItemsToAdd = []
const jsonExpanded = req.playlist.toOldJSONExpanded()
const addToTop = req.body.addToTop === true
// Setup array of playlistMediaItem records to add
let order = req.playlist.playlistMediaItems.length + 1
let order = addToTop ? 0 : (req.playlist.playlistMediaItems.length + 1)
for (const item of req.body.items) {
const libraryItem = libraryItems.find((li) => li.id === item.libraryItemId)