mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-18 21:07:44 +03:00
40 lines
846 B
Go
40 lines
846 B
Go
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,
|
|
NewTranscodingCache,
|
|
NewImageCache,
|
|
NewArchiver,
|
|
NewExternalInfo,
|
|
LastFMNewClient,
|
|
SpotifyNewClient,
|
|
transcoder.New,
|
|
)
|
|
|
|
func LastFMNewClient() *lastfm.Client {
|
|
if conf.Server.LastFM.ApiKey == "" {
|
|
return nil
|
|
}
|
|
|
|
return lastfm.NewClient(conf.Server.LastFM.ApiKey, conf.Server.LastFM.Language, http.DefaultClient)
|
|
}
|
|
|
|
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)
|
|
}
|