mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-26 10:30:46 +00:00
Some checks failed
Pipeline: Test, Lint, Build / Get version info (push) Has been cancelled
Pipeline: Test, Lint, Build / Lint Go code (push) Has been cancelled
Pipeline: Test, Lint, Build / Test Go code (push) Has been cancelled
Pipeline: Test, Lint, Build / Test JS code (push) Has been cancelled
Pipeline: Test, Lint, Build / Lint i18n files (push) Has been cancelled
Pipeline: Test, Lint, Build / Check Docker configuration (push) Has been cancelled
Pipeline: Test, Lint, Build / Build (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-1 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-2 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-3 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-4 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-5 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-6 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-7 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-8 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-9 (push) Has been cancelled
Pipeline: Test, Lint, Build / Build-10 (push) Has been cancelled
Pipeline: Test, Lint, Build / Push to GHCR (push) Has been cancelled
Pipeline: Test, Lint, Build / Push to Docker Hub (push) Has been cancelled
Pipeline: Test, Lint, Build / Cleanup digest artifacts (push) Has been cancelled
Pipeline: Test, Lint, Build / Build Windows installers (push) Has been cancelled
Pipeline: Test, Lint, Build / Package/Release (push) Has been cancelled
Pipeline: Test, Lint, Build / Upload Linux PKG (push) Has been cancelled
* feat(plugins): add lyrics provider plugin capability Refactor the lyrics system from a static function to an interface-based service that supports WASM plugin providers. Plugins listed in the LyricsPriority config (alongside "embedded" and file extensions) are now resolved through the plugin system. Includes capability definition, Go/Rust PDK, adapter, Wire integration, and tests for plugin fallback behavior. * test(plugins): add lyrics capability integration test with test plugin * fix(plugins): default lyrics language to 'xxx' when plugin omits it Per the OpenSubsonic spec, the server must return 'und' or 'xxx' when the lyrics language is unknown. The lyrics plugin adapter was passing an empty string through when a plugin didn't provide a language value. This defaults the language to 'xxx', consistent with all other callers of model.ToLyrics() in the codebase. * refactor(plugins): rename lyrics import to improve clarity Signed-off-by: Deluan <deluan@navidrome.org> * refactor(lyrics): update TrackInfo description for clarity Signed-off-by: Deluan <deluan@navidrome.org> * fix(lyrics): enhance lyrics plugin handling and case sensitivity Signed-off-by: Deluan <deluan@navidrome.org> * fix(plugins): update payload type to string with byte format for task data Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
137 lines
3 KiB
Go
137 lines
3 KiB
Go
//go:build wireinject
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/wire"
|
|
"github.com/navidrome/navidrome/adapters/lastfm"
|
|
"github.com/navidrome/navidrome/adapters/listenbrainz"
|
|
"github.com/navidrome/navidrome/core"
|
|
"github.com/navidrome/navidrome/core/agents"
|
|
"github.com/navidrome/navidrome/core/artwork"
|
|
"github.com/navidrome/navidrome/core/lyrics"
|
|
"github.com/navidrome/navidrome/core/metrics"
|
|
"github.com/navidrome/navidrome/core/playback"
|
|
"github.com/navidrome/navidrome/core/scrobbler"
|
|
"github.com/navidrome/navidrome/db"
|
|
"github.com/navidrome/navidrome/model"
|
|
"github.com/navidrome/navidrome/persistence"
|
|
"github.com/navidrome/navidrome/plugins"
|
|
"github.com/navidrome/navidrome/scanner"
|
|
"github.com/navidrome/navidrome/server"
|
|
"github.com/navidrome/navidrome/server/events"
|
|
"github.com/navidrome/navidrome/server/nativeapi"
|
|
"github.com/navidrome/navidrome/server/public"
|
|
"github.com/navidrome/navidrome/server/subsonic"
|
|
)
|
|
|
|
var allProviders = wire.NewSet(
|
|
core.Set,
|
|
artwork.Set,
|
|
server.New,
|
|
subsonic.New,
|
|
nativeapi.New,
|
|
public.New,
|
|
persistence.New,
|
|
lastfm.NewRouter,
|
|
listenbrainz.NewRouter,
|
|
events.GetBroker,
|
|
scanner.New,
|
|
scanner.GetWatcher,
|
|
metrics.GetPrometheusInstance,
|
|
db.Db,
|
|
plugins.GetManager,
|
|
wire.Bind(new(agents.PluginLoader), new(*plugins.Manager)),
|
|
wire.Bind(new(scrobbler.PluginLoader), new(*plugins.Manager)),
|
|
wire.Bind(new(lyrics.PluginLoader), new(*plugins.Manager)),
|
|
wire.Bind(new(nativeapi.PluginManager), new(*plugins.Manager)),
|
|
wire.Bind(new(core.PluginUnloader), new(*plugins.Manager)),
|
|
wire.Bind(new(plugins.PluginMetricsRecorder), new(metrics.Metrics)),
|
|
wire.Bind(new(core.Watcher), new(scanner.Watcher)),
|
|
)
|
|
|
|
func CreateDataStore() model.DataStore {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateServer() *server.Server {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateNativeAPIRouter(ctx context.Context) *nativeapi.Router {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateSubsonicAPIRouter(ctx context.Context) *subsonic.Router {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreatePublicRouter() *public.Router {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateLastFMRouter() *lastfm.Router {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateListenBrainzRouter() *listenbrainz.Router {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateInsights() metrics.Insights {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreatePrometheus() metrics.Metrics {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateScanner(ctx context.Context) model.Scanner {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func CreateScanWatcher(ctx context.Context) scanner.Watcher {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func GetPlaybackServer() playback.PlaybackServer {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func getPluginManager() *plugins.Manager {
|
|
panic(wire.Build(
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func GetPluginManager(ctx context.Context) *plugins.Manager {
|
|
manager := getPluginManager()
|
|
manager.SetSubsonicRouter(CreateSubsonicAPIRouter(ctx))
|
|
return manager
|
|
}
|