mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 13:07:36 +03:00
Make caches singletons
This commit is contained in:
parent
515528ee6d
commit
9b756faef5
6 changed files with 53 additions and 45 deletions
|
@ -26,7 +26,7 @@ func CreateServer(musicFolder string) *server.Server {
|
|||
|
||||
func CreateScanner(musicFolder string) scanner.Scanner {
|
||||
dataStore := persistence.New()
|
||||
artworkCache := core.NewImageCache()
|
||||
artworkCache := core.GetImageCache()
|
||||
artwork := core.NewArtwork(dataStore, artworkCache)
|
||||
cacheWarmer := core.NewCacheWarmer(artwork)
|
||||
scannerScanner := scanner.New(dataStore, cacheWarmer)
|
||||
|
@ -41,10 +41,10 @@ func CreateAppRouter() *app.Router {
|
|||
|
||||
func CreateSubsonicAPIRouter() *subsonic.Router {
|
||||
dataStore := persistence.New()
|
||||
artworkCache := core.NewImageCache()
|
||||
artworkCache := core.GetImageCache()
|
||||
artwork := core.NewArtwork(dataStore, artworkCache)
|
||||
transcoderTranscoder := transcoder.New()
|
||||
transcodingCache := core.NewTranscodingCache()
|
||||
transcodingCache := core.GetTranscodingCache()
|
||||
mediaStreamer := core.NewMediaStreamer(dataStore, transcoderTranscoder, transcodingCache)
|
||||
archiver := core.NewArchiver(dataStore)
|
||||
players := core.NewPlayers(dataStore)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue