mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-20 17:09:54 +01:00
fix: address race conditions and design issues in PlaylistGenerator
Rename PlaylistInfo.OwnerUserID to OwnerUsername so plugins provide usernames instead of internal user IDs, with server-side resolution via FindByUsername. Fix race condition on playlistGenerators map by using write lock in startPlaylistGenerators and moving map access inside the lock in unloadPlugin/Stop. Add context and WaitGroup to the orchestrator for proper cancellation and goroutine tracking. Include owner_id in the plugin playlist unique index. Use SetTracks instead of direct assignment to refresh playlist duration/size/song count stats.
This commit is contained in:
parent
188584e3fb
commit
a8a336de33
10 changed files with 71 additions and 42 deletions
|
|
@ -32,8 +32,8 @@ type GetPlaylistsResponse struct {
|
|||
type PlaylistInfo struct {
|
||||
// ID is the plugin-scoped unique identifier for this playlist.
|
||||
ID string `json:"id"`
|
||||
// OwnerUserID is the Navidrome user ID that owns this playlist.
|
||||
OwnerUserID string `json:"ownerUserId"`
|
||||
// OwnerUsername is the Navidrome username that owns this playlist.
|
||||
OwnerUsername string `json:"ownerUsername"`
|
||||
}
|
||||
|
||||
// GetPlaylistRequest is the request for GetPlaylist.
|
||||
|
|
|
|||
|
|
@ -79,12 +79,12 @@ components:
|
|||
id:
|
||||
type: string
|
||||
description: ID is the plugin-scoped unique identifier for this playlist.
|
||||
ownerUserId:
|
||||
ownerUsername:
|
||||
type: string
|
||||
description: OwnerUserID is the Navidrome user ID that owns this playlist.
|
||||
description: OwnerUsername is the Navidrome username that owns this playlist.
|
||||
required:
|
||||
- id
|
||||
- ownerUserId
|
||||
- ownerUsername
|
||||
SongRef:
|
||||
description: SongRef is a reference to a song with metadata for matching.
|
||||
properties:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue