Do not use lastFM api key and secret to determine if LastFM.Enabled should be set.

This commit is contained in:
Caio Cotts 2024-06-10 14:55:07 -04:00
parent e535f7eb78
commit 1b77830eb4
3 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
"enableSharing": conf.Server.EnableSharing,
"defaultDownloadableShare": conf.Server.DefaultDownloadableShare,
"devSidebarPlaylists": conf.Server.DevSidebarPlaylists,
"lastFMEnabled": conf.Server.LastFM.Enabled && conf.Server.LastFM.ApiKey != "" && conf.Server.LastFM.Secret != "",
"lastFMEnabled": conf.Server.LastFM.Enabled,
"devShowArtistPage": conf.Server.DevShowArtistPage,
"listenBrainzEnabled": conf.Server.ListenBrainz.Enabled,
"enableExternalServices": conf.Server.EnableExternalServices,

View File

@ -283,8 +283,6 @@ var _ = Describe("serveIndex", func() {
It("sets the lastFMEnabled", func() {
conf.Server.LastFM.Enabled = true
conf.Server.LastFM.ApiKey = "123"
conf.Server.LastFM.Secret = "456"
r := httptest.NewRequest("GET", "/index.html", nil)
w := httptest.NewRecorder()

View File

@ -27,7 +27,9 @@ const Personal = () => {
<SelectDefaultView />
{config.enableReplayGain && <ReplayGainToggle />}
<NotificationsToggle />
{config.lastFMEnabled && <LastfmScrobbleToggle />}
{config.lastFMEnabled && localStorage.getItem('lastfm-apikey') && (
<LastfmScrobbleToggle />
)}
{config.listenBrainzEnabled && <ListenBrainzScrobbleToggle />}
</SimpleForm>
</Card>