fix(plugins): cancel abandoned lyrics lookups

This commit is contained in:
ranokay 2026-08-25 20:53:01 +03:00
commit 6d4ac1506f
No known key found for this signature in database
3 changed files with 120 additions and 19 deletions

View file

@ -10,7 +10,6 @@ import (
extism "github.com/extism/go-sdk"
"github.com/navidrome/navidrome/model"
"github.com/tetratelabs/wazero"
"golang.org/x/sync/singleflight"
)
// plugin represents a loaded plugin
@ -25,9 +24,9 @@ type plugin struct {
allowedUserIDs []string // User IDs this plugin can access (from DB configuration)
allUsers bool // If true, plugin can access all users
libraries libraryAccess
lyricsSem chan struct{} // Caps concurrent lyrics calls (see LyricsPlugin.GetLyrics)
lyricsCalls singleflight.Group // Shared by the transient LyricsPlugin adapters
fsConfig wazero.FSConfig // Sandboxed library mounts, nil if no filesystem permission
lyricsSem chan struct{} // Caps concurrent lyrics calls (see LyricsPlugin.GetLyrics)
lyricsCalls lyricsCallGroup // Shared by the transient LyricsPlugin adapters
fsConfig wazero.FSConfig // Sandboxed library mounts, nil if no filesystem permission
}
// instanceConfig is used by every call site, so all instances get the sandboxed mounts.