🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Disable Last.FM features based on `LastFM.Enabled` config option
Deluancfb113bd331e
diff --git a/cmd/root.go b/cmd/root.goindex 8b8c1b2a9..20c4914ef 100644--- a/cmd/root.go+++ b/cmd/root.go@@ -76,7 +76,7 @@ func startServer() (func() error, func(err error)) {a := CreateServer(conf.Server.MusicFolder)a.MountRouter("Native API", consts.URLPathNativeAPI, CreateNativeAPIRouter())a.MountRouter("Subsonic API", consts.URLPathSubsonicAPI, CreateSubsonicAPIRouter())- if conf.Server.DevEnableScrobble {+ if conf.Server.LastFM.Enabled {a.MountRouter("LastFM Auth", consts.URLPathNativeAPI+"/lastfm", CreateLastFMRouter())}return a.Run(fmt.Sprintf("%s:%d", conf.Server.Address, conf.Server.Port))diff --git a/conf/configuration.go b/conf/configuration.goindex a7623fa3e..ab81de6db 100644--- a/conf/configuration.go+++ b/conf/configuration.go@@ -70,7 +70,6 @@ type configOptions struct {DevOldCacheLayout boolDevActivityPanel boolDevEnableShare bool- DevEnableScrobble bool}type scannerOptions struct {@@ -230,7 +229,6 @@ func init() {viper.SetDefault("devfastaccesscoverart", false)viper.SetDefault("devactivitypanel", true)viper.SetDefault("devenableshare", false)- viper.SetDefault("devenablescrobble", true)}func InitConfig(cfgFile string) {diff --git a/core/scrobbler/play_tracker.go b/core/scrobbler/play_tracker.goindex 7824c040b..0b8ebf761 100644--- a/core/scrobbler/play_tracker.go+++ b/core/scrobbler/play_tracker.go@@ -5,15 +5,11 @@ import ("sort""time"- "github.com/navidrome/navidrome/conf"-- "github.com/navidrome/navidrome/server/events"-- "github.com/navidrome/navidrome/log"-"github.com/ReneKroon/ttlcache/v2"+ "github.com/navidrome/navidrome/log""github.com/navidrome/navidrome/model""github.com/navidrome/navidrome/model/request"+ "github.com/navidrome/navidrome/server/events""github.com/navidrome/navidrome/utils/singleton")@@ -184,9 +180,6 @@ func (p *playTracker) dispatchScrobble(ctx context.Context, t *model.MediaFile,var constructors map[string]Constructorfunc Register(name string, init Constructor) {- if !conf.Server.DevEnableScrobble {- return- }if constructors == nil {constructors = make(map[string]Constructor)}diff --git a/core/scrobbler/play_tracker_test.go b/core/scrobbler/play_tracker_test.goindex 1d28f65a2..8467805bb 100644--- a/core/scrobbler/play_tracker_test.go+++ b/core/scrobbler/play_tracker_test.go@@ -5,7 +5,6 @@ import ("errors""time"- "github.com/navidrome/navidrome/conf""github.com/navidrome/navidrome/model""github.com/navidrome/navidrome/model/request""github.com/navidrome/navidrome/server/events"@@ -24,7 +23,6 @@ var _ = Describe("PlayTracker", func() {var fake fakeScrobblerBeforeEach(func() {- conf.Server.DevEnableScrobble = truectx = context.Background()ctx = request.WithUser(ctx, model.User{ID: "u-1"})ctx = request.WithPlayer(ctx, model.Player{ScrobbleEnabled: true})diff --git a/server/serve_index.go b/server/serve_index.goindex d7878ee29..1bafe505b 100644--- a/server/serve_index.go+++ b/server/serve_index.go@@ -45,7 +45,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {"devFastAccessCoverArt": conf.Server.DevFastAccessCoverArt,"enableUserEditing": conf.Server.EnableUserEditing,"devEnableShare": conf.Server.DevEnableShare,- "devEnableScrobble": conf.Server.DevEnableScrobble,+ "lastFMEnabled": conf.Server.LastFM.Enabled,"lastFMApiKey": conf.Server.LastFM.ApiKey,}auth := handleLoginFromHeaders(ds, r)diff --git a/server/serve_index_test.go b/server/serve_index_test.goindex a5a155ca4..75ca0be39 100644--- a/server/serve_index_test.go+++ b/server/serve_index_test.go@@ -211,14 +211,14 @@ var _ = Describe("serveIndex", func() {Expect(config).To(HaveKeyWithValue("devEnableShare", false))})- It("sets the devEnableScrobble", func() {+ It("sets the lastFMEnabled", func() {r := httptest.NewRequest("GET", "/index.html", nil)w := httptest.NewRecorder()serveIndex(ds, fs)(w, r)config := extractAppConfig(w.Body.String())- Expect(config).To(HaveKeyWithValue("devEnableScrobble", true))+ Expect(config).To(HaveKeyWithValue("lastFMEnabled", true))})It("sets the lastFMApiKey", func() {diff --git a/ui/src/config.js b/ui/src/config.jsindex 1e7fa5df0..d4da2f61b 100644--- a/ui/src/config.js+++ b/ui/src/config.js@@ -19,7 +19,7 @@ const defaultConfig = {defaultTheme: 'Dark',enableUserEditing: true,devEnableShare: true,- devEnableScrobble: true,+ lastFMEnabled: true,lastFMApiKey: '9b94a5515ea66b2da3ec03c12300327e',enableCoverAnimation: true,}diff --git a/ui/src/personal/Personal.js b/ui/src/personal/Personal.jsindex 8e0c8067e..07f4e4c91 100644--- a/ui/src/personal/Personal.js+++ b/ui/src/personal/Personal.js@@ -24,7 +24,7 @@ const Personal = () => {<SelectLanguage /><SelectDefaultView /><NotificationsToggle />- {config.devEnableScrobble && <LastfmScrobbleToggle />}+ {config.lastFMEnabled && <LastfmScrobbleToggle />}</SimpleForm></Card>)diff --git a/ui/src/player/PlayerEdit.js b/ui/src/player/PlayerEdit.jsindex 6207ad4f4..ea709ea9c 100644--- a/ui/src/player/PlayerEdit.js+++ b/ui/src/player/PlayerEdit.js@@ -48,7 +48,7 @@ const PlayerEdit = (props) => (]}/><BooleanInput source="reportRealPath" fullWidth />- {config.devEnableScrobble && (+ {config.lastFMEnabled && (<BooleanInput source="scrobbleEnabled" fullWidth />)}<TextField source="client" />