navidrome/core/wire_providers.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
902 B
Go
Raw Normal View History

package core
import (
"net/http"
"github.com/deluan/navidrome/conf"
"github.com/deluan/navidrome/core/lastfm"
"github.com/deluan/navidrome/core/spotify"
"github.com/deluan/navidrome/core/transcoder"
"github.com/google/wire"
)
var Set = wire.NewSet(
NewArtwork,
NewMediaStreamer,
2020-10-27 22:02:20 +01:00
GetTranscodingCache,
GetImageCache,
NewArchiver,
2020-10-27 15:19:58 +01:00
NewNowPlayingRepository,
NewExternalInfo,
NewCacheWarmer,
NewPlayers,
LastFMNewClient,
SpotifyNewClient,
transcoder.New,
)
2020-10-20 21:46:18 +02:00
func LastFMNewClient() *lastfm.Client {
if conf.Server.LastFM.ApiKey == "" {
return nil
}
return lastfm.NewClient(conf.Server.LastFM.ApiKey, conf.Server.LastFM.Language, http.DefaultClient)
}
2020-10-20 21:46:18 +02:00
func SpotifyNewClient() *spotify.Client {
if conf.Server.Spotify.ID == "" || conf.Server.Spotify.Secret == "" {
return nil
}
return spotify.NewClient(conf.Server.Spotify.ID, conf.Server.Spotify.Secret, http.DefaultClient)
}