Skip to content

🎧 Your Personal Streaming Service

Don't show Artist Page for "Various Artists"

Deluanc6868ff8a037
diff --git a/server/serve_index.go b/server/serve_index.go
index 6946b4828..424f2ffd6 100644
--- a/server/serve_index.go
+++ b/server/serve_index.go
@@ -30,6 +30,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {
appConfig := map[string]interface{}{
"version": consts.Version(),
"firstTime": firstTime,
+ "variousArtistsId": consts.VariousArtistsID,
"baseURL": policy.Sanitize(strings.TrimSuffix(conf.Server.BaseURL, "/")),
"loginBackgroundURL": policy.Sanitize(conf.Server.UILoginBackgroundURL),
"welcomeMessage": policy.Sanitize(conf.Server.UIWelcomeMessage),
diff --git a/server/serve_index_test.go b/server/serve_index_test.go
index ec6893e65..e303dbf6a 100644
--- a/server/serve_index_test.go
+++ b/server/serve_index_test.go
@@ -49,6 +49,17 @@ var _ = Describe("serveIndex", func() {
Expect(config).To(HaveKeyWithValue("firstTime", true))
})
+ It("includes the VariousArtistsID", func() {
+ mockUser.empty = 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("variousArtistsId", consts.VariousArtistsID))
+ })
+
It("sets firstTime = false when User table is not empty", func() {
mockUser.empty = false
r := httptest.NewRequest("GET", "/index.html", nil)
diff --git a/ui/src/common/ArtistLinkField.js b/ui/src/common/ArtistLinkField.js
index 0ff5f89b1..5d1950b67 100644
--- a/ui/src/common/ArtistLinkField.js
+++ b/ui/src/common/ArtistLinkField.js
@@ -8,7 +8,7 @@ import config from '../config'
export const useGetHandleArtistClick = (width) => {
const [perPage] = useAlbumsPerPage(width)
return (id) => {
- return config.devShowArtistPage
+ return config.devShowArtistPage && id !== config.variousArtistsId
? `/artist/${id}/show`
: `/album?filter={"artist_id":"${id}"}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}&perPage=${perPage}`
}
diff --git a/ui/src/config.js b/ui/src/config.js
index 8180db0f3..a3ea44f04 100644
--- a/ui/src/config.js
+++ b/ui/src/config.js
@@ -5,6 +5,7 @@ const defaultConfig = {
version: 'dev',
firstTime: false,
baseURL: '',
+ variousArtistsId: '03b645ef2100dfc42fa9785ea3102295', // See consts.VariousArtistsID in consts.go
// Login backgrounds from https://unsplash.com/collections/1065384/music-wallpapers
loginBackgroundURL: 'https://source.unsplash.com/collection/1065384/1600x900',
enableTranscodingConfig: true,