Don't show Artist Page for "Various Artists"
This commit is contained in:
@@ -30,6 +30,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {
|
|||||||
appConfig := map[string]interface{}{
|
appConfig := map[string]interface{}{
|
||||||
"version": consts.Version(),
|
"version": consts.Version(),
|
||||||
"firstTime": firstTime,
|
"firstTime": firstTime,
|
||||||
|
"variousArtistsId": consts.VariousArtistsID,
|
||||||
"baseURL": policy.Sanitize(strings.TrimSuffix(conf.Server.BaseURL, "/")),
|
"baseURL": policy.Sanitize(strings.TrimSuffix(conf.Server.BaseURL, "/")),
|
||||||
"loginBackgroundURL": policy.Sanitize(conf.Server.UILoginBackgroundURL),
|
"loginBackgroundURL": policy.Sanitize(conf.Server.UILoginBackgroundURL),
|
||||||
"welcomeMessage": policy.Sanitize(conf.Server.UIWelcomeMessage),
|
"welcomeMessage": policy.Sanitize(conf.Server.UIWelcomeMessage),
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ var _ = Describe("serveIndex", func() {
|
|||||||
Expect(config).To(HaveKeyWithValue("firstTime", true))
|
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() {
|
It("sets firstTime = false when User table is not empty", func() {
|
||||||
mockUser.empty = false
|
mockUser.empty = false
|
||||||
r := httptest.NewRequest("GET", "/index.html", nil)
|
r := httptest.NewRequest("GET", "/index.html", nil)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import config from '../config'
|
|||||||
export const useGetHandleArtistClick = (width) => {
|
export const useGetHandleArtistClick = (width) => {
|
||||||
const [perPage] = useAlbumsPerPage(width)
|
const [perPage] = useAlbumsPerPage(width)
|
||||||
return (id) => {
|
return (id) => {
|
||||||
return config.devShowArtistPage
|
return config.devShowArtistPage && id !== config.variousArtistsId
|
||||||
? `/artist/${id}/show`
|
? `/artist/${id}/show`
|
||||||
: `/album?filter={"artist_id":"${id}"}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}&perPage=${perPage}`
|
: `/album?filter={"artist_id":"${id}"}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}&perPage=${perPage}`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const defaultConfig = {
|
|||||||
version: 'dev',
|
version: 'dev',
|
||||||
firstTime: false,
|
firstTime: false,
|
||||||
baseURL: '',
|
baseURL: '',
|
||||||
|
variousArtistsId: '03b645ef2100dfc42fa9785ea3102295', // See consts.VariousArtistsID in consts.go
|
||||||
// Login backgrounds from https://unsplash.com/collections/1065384/music-wallpapers
|
// Login backgrounds from https://unsplash.com/collections/1065384/music-wallpapers
|
||||||
loginBackgroundURL: 'https://source.unsplash.com/collection/1065384/1600x900',
|
loginBackgroundURL: 'https://source.unsplash.com/collection/1065384/1600x900',
|
||||||
enableTranscodingConfig: true,
|
enableTranscodingConfig: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user