// Code generated by Wire. DO NOT EDIT.

//go:generate go run -mod=mod github.com/google/wire/cmd/wire gen -tags "netgo sqlite_fts5"
//go:build !wireinject
// +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/external"
	"github.com/navidrome/navidrome/core/ffmpeg"
	"github.com/navidrome/navidrome/core/lyrics"
	"github.com/navidrome/navidrome/core/matcher"
	"github.com/navidrome/navidrome/core/metrics"
	"github.com/navidrome/navidrome/core/playback"
	"github.com/navidrome/navidrome/core/playlists"
	"github.com/navidrome/navidrome/core/scrobbler"
	"github.com/navidrome/navidrome/core/sonic"
	"github.com/navidrome/navidrome/core/stream"
	"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"
)

import (
	_ "github.com/navidrome/navidrome/adapters/deezer"
	_ "github.com/navidrome/navidrome/adapters/gotaglib"
	_ "github.com/navidrome/navidrome/adapters/lastfm"
	_ "github.com/navidrome/navidrome/adapters/listenbrainz"
)

// Injectors from wire_injectors.go:

func CreateDataStore() model.DataStore {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	return dataStore
}

func CreateServer() *server.Server {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	broker := events.GetBroker()
	insights := metrics.GetInstance(dataStore)
	serverServer := server.New(dataStore, broker, insights)
	return serverServer
}

func CreateNativeAPIRouter(ctx context.Context) *nativeapi.Router {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	share := core.NewShare(dataStore)
	imageUploadService := core.NewImageUploadService()
	playlistsPlaylists := playlists.NewPlaylists(dataStore, imageUploadService)
	insights := metrics.GetInstance(dataStore)
	fileCache := artwork.GetImageCache()
	fFmpeg := ffmpeg.New()
	broker := events.GetBroker()
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	manager := plugins.GetManager(dataStore, broker, metricsMetrics)
	agentsAgents := agents.GetAgents(dataStore, manager)
	matcherMatcher := matcher.New(dataStore)
	provider := external.NewProvider(dataStore, agentsAgents, matcherMatcher)
	artworkArtwork := artwork.NewArtwork(dataStore, fileCache, fFmpeg, provider)
	cacheWarmer := artwork.NewCacheWarmer(artworkArtwork, fileCache)
	modelScanner := scanner.New(ctx, dataStore, cacheWarmer, broker, playlistsPlaylists, metricsMetrics)
	watcher := scanner.GetWatcher(dataStore, modelScanner)
	library := core.NewLibrary(dataStore, modelScanner, watcher, broker, manager)
	user := core.NewUser(dataStore, manager)
	maintenance := core.NewMaintenance(dataStore)
	router := nativeapi.New(dataStore, share, playlistsPlaylists, insights, library, user, maintenance, manager, imageUploadService)
	return router
}

func CreateSubsonicAPIRouter(ctx context.Context) *subsonic.Router {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	fileCache := artwork.GetImageCache()
	fFmpeg := ffmpeg.New()
	broker := events.GetBroker()
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	manager := plugins.GetManager(dataStore, broker, metricsMetrics)
	agentsAgents := agents.GetAgents(dataStore, manager)
	matcherMatcher := matcher.New(dataStore)
	provider := external.NewProvider(dataStore, agentsAgents, matcherMatcher)
	artworkArtwork := artwork.NewArtwork(dataStore, fileCache, fFmpeg, provider)
	transcodingCache := stream.GetTranscodingCache()
	mediaStreamer := stream.NewMediaStreamer(dataStore, fFmpeg, transcodingCache)
	share := core.NewShare(dataStore)
	archiver := core.NewArchiver(mediaStreamer, dataStore, share)
	players := core.NewPlayers(dataStore)
	cacheWarmer := artwork.NewCacheWarmer(artworkArtwork, fileCache)
	imageUploadService := core.NewImageUploadService()
	playlistsPlaylists := playlists.NewPlaylists(dataStore, imageUploadService)
	modelScanner := scanner.New(ctx, dataStore, cacheWarmer, broker, playlistsPlaylists, metricsMetrics)
	playTracker := scrobbler.GetPlayTracker(dataStore, broker, manager)
	playbackServer := playback.GetInstance(dataStore)
	lyricsLyrics := lyrics.NewLyrics(manager)
	transcodeDecider := stream.NewTranscodeDecider(dataStore, fFmpeg)
	sonicSonic := sonic.New(dataStore, manager, matcherMatcher)
	router := subsonic.New(dataStore, artworkArtwork, mediaStreamer, archiver, players, provider, modelScanner, broker, playlistsPlaylists, playTracker, share, playbackServer, metricsMetrics, lyricsLyrics, transcodeDecider, sonicSonic)
	return router
}

func CreatePublicRouter() *public.Router {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	fileCache := artwork.GetImageCache()
	fFmpeg := ffmpeg.New()
	broker := events.GetBroker()
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	manager := plugins.GetManager(dataStore, broker, metricsMetrics)
	agentsAgents := agents.GetAgents(dataStore, manager)
	matcherMatcher := matcher.New(dataStore)
	provider := external.NewProvider(dataStore, agentsAgents, matcherMatcher)
	artworkArtwork := artwork.NewArtwork(dataStore, fileCache, fFmpeg, provider)
	transcodingCache := stream.GetTranscodingCache()
	mediaStreamer := stream.NewMediaStreamer(dataStore, fFmpeg, transcodingCache)
	share := core.NewShare(dataStore)
	archiver := core.NewArchiver(mediaStreamer, dataStore, share)
	router := public.New(dataStore, artworkArtwork, mediaStreamer, share, archiver)
	return router
}

func CreateLastFMRouter() *lastfm.Router {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	router := lastfm.NewRouter(dataStore)
	return router
}

func CreateListenBrainzRouter() *listenbrainz.Router {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	router := listenbrainz.NewRouter(dataStore)
	return router
}

func CreateInsights() metrics.Insights {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	insights := metrics.GetInstance(dataStore)
	return insights
}

func CreatePrometheus() metrics.Metrics {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	return metricsMetrics
}

func CreateScanner(ctx context.Context) model.Scanner {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	fileCache := artwork.GetImageCache()
	fFmpeg := ffmpeg.New()
	broker := events.GetBroker()
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	manager := plugins.GetManager(dataStore, broker, metricsMetrics)
	agentsAgents := agents.GetAgents(dataStore, manager)
	matcherMatcher := matcher.New(dataStore)
	provider := external.NewProvider(dataStore, agentsAgents, matcherMatcher)
	artworkArtwork := artwork.NewArtwork(dataStore, fileCache, fFmpeg, provider)
	cacheWarmer := artwork.NewCacheWarmer(artworkArtwork, fileCache)
	imageUploadService := core.NewImageUploadService()
	playlistsPlaylists := playlists.NewPlaylists(dataStore, imageUploadService)
	modelScanner := scanner.New(ctx, dataStore, cacheWarmer, broker, playlistsPlaylists, metricsMetrics)
	return modelScanner
}

func CreateScanWatcher(ctx context.Context) scanner.Watcher {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	fileCache := artwork.GetImageCache()
	fFmpeg := ffmpeg.New()
	broker := events.GetBroker()
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	manager := plugins.GetManager(dataStore, broker, metricsMetrics)
	agentsAgents := agents.GetAgents(dataStore, manager)
	matcherMatcher := matcher.New(dataStore)
	provider := external.NewProvider(dataStore, agentsAgents, matcherMatcher)
	artworkArtwork := artwork.NewArtwork(dataStore, fileCache, fFmpeg, provider)
	cacheWarmer := artwork.NewCacheWarmer(artworkArtwork, fileCache)
	imageUploadService := core.NewImageUploadService()
	playlistsPlaylists := playlists.NewPlaylists(dataStore, imageUploadService)
	modelScanner := scanner.New(ctx, dataStore, cacheWarmer, broker, playlistsPlaylists, metricsMetrics)
	watcher := scanner.GetWatcher(dataStore, modelScanner)
	return watcher
}

func GetPlaybackServer() playback.PlaybackServer {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	playbackServer := playback.GetInstance(dataStore)
	return playbackServer
}

func getPluginManager() *plugins.Manager {
	sqlDB := db.Db()
	dataStore := persistence.New(sqlDB)
	broker := events.GetBroker()
	metricsMetrics := metrics.GetPrometheusInstance(dataStore)
	manager := plugins.GetManager(dataStore, broker, metricsMetrics)
	return manager
}

// wire_injectors.go:

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, sonic.New, 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(sonic.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 GetPluginManager(ctx context.Context) *plugins.Manager {
	manager := getPluginManager()
	manager.SetSubsonicRouter(CreateSubsonicAPIRouter(ctx))
	return manager
}
