mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-05 05:27:37 +03:00
111 lines
4 KiB
Go
111 lines
4 KiB
Go
// Code generated by Wire. DO NOT EDIT.
|
|
|
|
//go:generate wire
|
|
//+build !wireinject
|
|
|
|
package api
|
|
|
|
import (
|
|
"github.com/cloudsonic/sonic-server/engine"
|
|
"github.com/cloudsonic/sonic-server/itunesbridge"
|
|
"github.com/cloudsonic/sonic-server/persistence"
|
|
"github.com/deluan/gomate"
|
|
"github.com/deluan/gomate/ledis"
|
|
"github.com/google/wire"
|
|
)
|
|
|
|
// Injectors from wire_injectors.go:
|
|
|
|
func initSystemController() *SystemController {
|
|
systemController := NewSystemController()
|
|
return systemController
|
|
}
|
|
|
|
func initBrowsingController() *BrowsingController {
|
|
propertyRepository := persistence.NewPropertyRepository()
|
|
mediaFolderRepository := persistence.NewMediaFolderRepository()
|
|
artistIndexRepository := persistence.NewArtistIndexRepository()
|
|
artistRepository := persistence.NewArtistRepository()
|
|
albumRepository := persistence.NewAlbumRepository()
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
browser := engine.NewBrowser(propertyRepository, mediaFolderRepository, artistIndexRepository, artistRepository, albumRepository, mediaFileRepository)
|
|
browsingController := NewBrowsingController(browser)
|
|
return browsingController
|
|
}
|
|
|
|
func initAlbumListController() *AlbumListController {
|
|
albumRepository := persistence.NewAlbumRepository()
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
nowPlayingRepository := persistence.NewNowPlayingRepository()
|
|
listGenerator := engine.NewListGenerator(albumRepository, mediaFileRepository, nowPlayingRepository)
|
|
albumListController := NewAlbumListController(listGenerator)
|
|
return albumListController
|
|
}
|
|
|
|
func initMediaAnnotationController() *MediaAnnotationController {
|
|
itunesControl := itunesbridge.NewItunesControl()
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
nowPlayingRepository := persistence.NewNowPlayingRepository()
|
|
scrobbler := engine.NewScrobbler(itunesControl, mediaFileRepository, nowPlayingRepository)
|
|
albumRepository := persistence.NewAlbumRepository()
|
|
artistRepository := persistence.NewArtistRepository()
|
|
ratings := engine.NewRatings(itunesControl, mediaFileRepository, albumRepository, artistRepository)
|
|
mediaAnnotationController := NewMediaAnnotationController(scrobbler, ratings)
|
|
return mediaAnnotationController
|
|
}
|
|
|
|
func initPlaylistsController() *PlaylistsController {
|
|
itunesControl := itunesbridge.NewItunesControl()
|
|
playlistRepository := persistence.NewPlaylistRepository()
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
playlists := engine.NewPlaylists(itunesControl, playlistRepository, mediaFileRepository)
|
|
playlistsController := NewPlaylistsController(playlists)
|
|
return playlistsController
|
|
}
|
|
|
|
func initSearchingController() *SearchingController {
|
|
artistRepository := persistence.NewArtistRepository()
|
|
albumRepository := persistence.NewAlbumRepository()
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
db := newDB()
|
|
search := engine.NewSearch(artistRepository, albumRepository, mediaFileRepository, db)
|
|
searchingController := NewSearchingController(search)
|
|
return searchingController
|
|
}
|
|
|
|
func initUsersController() *UsersController {
|
|
usersController := NewUsersController()
|
|
return usersController
|
|
}
|
|
|
|
func initMediaRetrievalController() *MediaRetrievalController {
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
albumRepository := persistence.NewAlbumRepository()
|
|
cover := engine.NewCover(mediaFileRepository, albumRepository)
|
|
mediaRetrievalController := NewMediaRetrievalController(cover)
|
|
return mediaRetrievalController
|
|
}
|
|
|
|
func initStreamController() *StreamController {
|
|
mediaFileRepository := persistence.NewMediaFileRepository()
|
|
streamController := NewStreamController(mediaFileRepository)
|
|
return streamController
|
|
}
|
|
|
|
// wire_injectors.go:
|
|
|
|
var allProviders = wire.NewSet(itunesbridge.NewItunesControl, persistence.Set, engine.Set, NewSystemController,
|
|
NewBrowsingController,
|
|
NewAlbumListController,
|
|
NewMediaAnnotationController,
|
|
NewPlaylistsController,
|
|
NewSearchingController,
|
|
NewUsersController,
|
|
NewMediaRetrievalController,
|
|
NewStreamController,
|
|
newDB,
|
|
)
|
|
|
|
func newDB() gomate.DB {
|
|
return ledis.NewEmbeddedDB(persistence.Db())
|
|
}
|