Added buttons to add items to the top or bottom of a playlist.

This commit is contained in:
sir-wilhelm 2025-12-12 18:34:50 +00:00
parent 122fc34a75
commit 6c94913cb2
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)