feat(server): add update and clear play queue endpoints to native API (#4215)

* Refactor queue payload handling

* Refine queue update validation

* refactor(queue): avoid loading tracks for validation

* refactor/rename repository methods

Signed-off-by: Deluan <deluan@navidrome.org>

* more tests

Signed-off-by: Deluan <deluan@navidrome.org>

* refactor

Signed-off-by: Deluan <deluan@navidrome.org>

---------

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan Quintão
2025-06-11 12:02:31 -04:00
committed by GitHub
parent 356caa93c7
commit 410e457e5a
8 changed files with 616 additions and 51 deletions

View File

@@ -18,6 +18,11 @@ type PlayQueue struct {
type PlayQueues []PlayQueue
type PlayQueueRepository interface {
Store(queue *PlayQueue) error
Store(queue *PlayQueue, colNames ...string) error
// Retrieve returns the playqueue without loading the full MediaFiles
// (Items only contain IDs)
Retrieve(userId string) (*PlayQueue, error)
// RetrieveWithMediaFiles returns the playqueue with full MediaFiles loaded
RetrieveWithMediaFiles(userId string) (*PlayQueue, error)
Clear(userId string) error
}