Enable turn on/off Favorites/Loved feature. (#917)
* Added option to enable/disable favorites in Song * Added option to enable/disable favorites in Artist * Added option to enable/disable favorites in Albums and Favorites tab in sidebar * Added option to enable/disable favorites in Player * Set default value of enableFavourites as true * Improved the functionality to enable/disable Favorites * Add `EnableFavourites` config option Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -36,6 +36,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {
|
||||
"enableTranscodingConfig": conf.Server.EnableTranscodingConfig,
|
||||
"gaTrackingId": conf.Server.GATrackingID,
|
||||
"enableDownloads": conf.Server.EnableDownloads,
|
||||
"enableFavourites": conf.Server.EnableFavourites,
|
||||
"devActivityPanel": conf.Server.DevActivityPanel,
|
||||
"devFastAccessCoverArt": conf.Server.DevFastAccessCoverArt,
|
||||
}
|
||||
|
||||
@@ -114,6 +114,17 @@ var _ = Describe("serveIndex", func() {
|
||||
Expect(config).To(HaveKeyWithValue("enableDownloads", true))
|
||||
})
|
||||
|
||||
It("sets the enableLoved", func() {
|
||||
conf.Server.EnableFavourites = true
|
||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
serveIndex(ds, fs)(w, r)
|
||||
|
||||
config := extractAppConfig(w.Body.String())
|
||||
Expect(config).To(HaveKeyWithValue("enableFavourites", true))
|
||||
})
|
||||
|
||||
It("sets the gaTrackingId", func() {
|
||||
conf.Server.GATrackingID = "UA-12345"
|
||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||
|
||||
Reference in New Issue
Block a user