Add option to change max playlists shown in UI's sidebar, MaxSidebarPlaylists. Fix #2077
This commit is contained in:
@@ -44,6 +44,7 @@ func serveIndex(ds model.DataStore, fs fs.FS, shareInfo *model.Share) http.Handl
|
||||
"baseURL": utils.SanitizeText(strings.TrimSuffix(conf.Server.BaseURL, "/")),
|
||||
"loginBackgroundURL": utils.SanitizeText(conf.Server.UILoginBackgroundURL),
|
||||
"welcomeMessage": utils.SanitizeText(conf.Server.UIWelcomeMessage),
|
||||
"maxSidebarPlaylists": conf.Server.MaxSidebarPlaylists,
|
||||
"enableTranscodingConfig": conf.Server.EnableTranscodingConfig,
|
||||
"enableDownloads": conf.Server.EnableDownloads,
|
||||
"enableFavourites": conf.Server.EnableFavourites,
|
||||
|
||||
@@ -94,6 +94,17 @@ var _ = Describe("serveIndex", func() {
|
||||
Expect(config).To(HaveKeyWithValue("welcomeMessage", "Hello"))
|
||||
})
|
||||
|
||||
It("sets the maxSidebarPlaylists", func() {
|
||||
conf.Server.MaxSidebarPlaylists = 42
|
||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
serveIndex(ds, fs, nil)(w, r)
|
||||
|
||||
config := extractAppConfig(w.Body.String())
|
||||
Expect(config).To(HaveKeyWithValue("maxSidebarPlaylists", float64(42)))
|
||||
})
|
||||
|
||||
It("sets the enableTranscodingConfig", func() {
|
||||
conf.Server.EnableTranscodingConfig = true
|
||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||
|
||||
Reference in New Issue
Block a user