[web] Rename pages for more coherence

This commit is contained in:
Alain Nussbaumer 2025-05-24 10:18:36 +02:00
parent 59050c1018
commit 04c119a3fd
12 changed files with 49 additions and 62 deletions

View File

@ -59,13 +59,11 @@ export default {
const mediaKind = this.mediaKind || this.selectedItem.media_kind const mediaKind = this.mediaKind || this.selectedItem.media_kind
if (mediaKind === 'podcast') { if (mediaKind === 'podcast') {
this.$router.push({ name: 'podcast', params: { id: item.id } }) this.$router.push({ name: 'podcast', params: { id: item.id } })
} else if (mediaKind === 'audiobook') { } else {
this.$router.push({ this.$router.push({
name: 'audiobooks-album', name: `${mediaKind}-album`,
params: { id: item.id } params: { id: item.id }
}) })
} else {
this.$router.push({ name: 'music-album', params: { id: item.id } })
} }
}, },
openDetails(item) { openDetails(item) {

View File

@ -33,9 +33,10 @@ export default {
methods: { methods: {
open(item) { open(item) {
this.selectedItem = item this.selectedItem = item
const route = this.$router.push({
item.media_kind === 'audiobook' ? 'audiobooks-artist' : 'music-artist' name: `${item.media_kind}-artist`,
this.$router.push({ name: route, params: { id: item.id } }) params: { id: item.id }
})
}, },
openDetails(item) { openDetails(item) {
this.selectedItem = item this.selectedItem = item

View File

@ -60,7 +60,7 @@ export default {
] ]
}, },
buttons() { buttons() {
if (this.mediaKindResolved === 'podcast') { if (this.computedMediaKind === 'podcast') {
if (this.item.data_kind === 'url') { if (this.item.data_kind === 'url') {
return [ return [
{ handler: this.markAsPlayed, key: 'actions.mark-as-played' }, { handler: this.markAsPlayed, key: 'actions.mark-as-played' },
@ -74,7 +74,7 @@ export default {
} }
return [] return []
}, },
mediaKindResolved() { computedMediaKind() {
return this.mediaKind || this.item.media_kind return this.mediaKind || this.item.media_kind
}, },
playable() { playable() {
@ -122,17 +122,10 @@ export default {
}, },
openArtist() { openArtist() {
this.$emit('close') this.$emit('close')
if (this.mediaKindResolved === 'audiobook') {
this.$router.push({ this.$router.push({
name: 'audiobooks-artist', name: `${this.computedMediaKind}-artist`,
params: { id: this.item.artist_id } params: { id: this.item.artist_id }
}) })
} else {
this.$router.push({
name: 'music-artist',
params: { id: this.item.artist_id }
})
}
}, },
openRemovePodcastDialog() { openRemovePodcastDialog() {
this.showRemovePodcastModal = true this.showRemovePodcastModal = true

View File

@ -115,14 +115,9 @@ export default {
name: 'podcast', name: 'podcast',
params: { id: this.item.album_id } params: { id: this.item.album_id }
}) })
} else if (this.item.media_kind === 'audiobook') { } else {
this.$router.push({ this.$router.push({
name: 'audiobooks-album', name: `${this.item.media_kind}-album`,
params: { id: this.item.album_id }
})
} else if (this.item.media_kind === 'music') {
this.$router.push({
name: 'music-album',
params: { id: this.item.album_id } params: { id: this.item.album_id }
}) })
} }
@ -144,7 +139,7 @@ export default {
}) })
} else if (this.item.media_kind === 'audiobook') { } else if (this.item.media_kind === 'audiobook') {
this.$router.push({ this.$router.push({
name: 'audiobooks-artist', name: 'audiobook-artist',
params: { id: this.item.album_artist_id } params: { id: this.item.album_artist_id }
}) })
} }

View File

@ -20,10 +20,10 @@ export default {
buttons() { buttons() {
if (this.item.media_kind !== 'podcast') { if (this.item.media_kind !== 'podcast') {
return [] return []
} else if (this.item.play_count > 0) {
return [{ handler: this.markAsNew, key: 'actions.mark-as-new' }]
} }
return this.item.play_count > 0 return [{ handler: this.markAsPlayed, key: 'actions.mark-as-played' }]
? [{ handler: this.markAsNew, key: 'actions.mark-as-new' }]
: [{ handler: this.markAsPlayed, key: 'actions.mark-as-played' }]
}, },
playable() { playable() {
return { return {
@ -114,7 +114,7 @@ export default {
}) })
} else if (this.item.media_kind === 'audiobook') { } else if (this.item.media_kind === 'audiobook') {
this.$router.push({ this.$router.push({
name: 'audiobooks-album', name: 'audiobook-album',
params: { id: this.item.album_id } params: { id: this.item.album_id }
}) })
} else if (this.item.media_kind === 'music') { } else if (this.item.media_kind === 'music') {
@ -136,7 +136,7 @@ export default {
}) })
} else if (this.item.media_kind === 'audiobook') { } else if (this.item.media_kind === 'audiobook') {
this.$router.push({ this.$router.push({
name: 'audiobooks-artist', name: 'audiobook-artist',
params: { id: this.item.album_artist_id } params: { id: this.item.album_artist_id }
}) })
} }

View File

@ -14,17 +14,17 @@ export default {
{ {
icon: 'account-music', icon: 'account-music',
key: 'page.audiobooks.tabs.authors', key: 'page.audiobooks.tabs.authors',
to: { name: 'audiobooks-artists' } to: { name: 'audiobook-artists' }
}, },
{ {
icon: 'album', icon: 'album',
key: 'page.audiobooks.tabs.audiobooks', key: 'page.audiobooks.tabs.audiobooks',
to: { name: 'audiobooks-albums' } to: { name: 'audiobook-albums' }
}, },
{ {
icon: 'speaker', icon: 'speaker',
key: 'page.audiobooks.tabs.genres', key: 'page.audiobooks.tabs.genres',
to: { name: 'audiobooks-genres' } to: { name: 'audiobook-genres' }
} }
] ]
} }

View File

@ -34,7 +34,7 @@ import library from '@/api/library'
import queue from '@/api/queue' import queue from '@/api/queue'
export default { export default {
name: 'PageAudiobooksAlbum', name: 'PageAudiobookAlbum',
components: { components: {
ContentWithHero, ContentWithHero,
ControlImage, ControlImage,
@ -78,7 +78,7 @@ export default {
openArtist() { openArtist() {
this.showDetailsModal = false this.showDetailsModal = false
this.$router.push({ this.$router.push({
name: 'audiobooks-artist', name: 'audiobook-artist',
params: { id: this.album.artist_id } params: { id: this.album.artist_id }
}) })
}, },

View File

@ -23,7 +23,7 @@ import TabsAudiobooks from '@/components/TabsAudiobooks.vue'
import library from '@/api/library' import library from '@/api/library'
export default { export default {
name: 'PageAudiobooksAlbums', name: 'PageAudiobookAlbums',
components: { components: {
ContentWithHeading, ContentWithHeading,
ListIndexButtons, ListIndexButtons,

View File

@ -33,7 +33,7 @@ import library from '@/api/library'
import queue from '@/api/queue' import queue from '@/api/queue'
export default { export default {
name: 'PageAudiobooksArtist', name: 'PageAudiobookArtist',
components: { components: {
ContentWithHeading, ContentWithHeading,
ControlButton, ControlButton,

View File

@ -23,7 +23,7 @@ import TabsAudiobooks from '@/components/TabsAudiobooks.vue'
import library from '@/api/library' import library from '@/api/library'
export default { export default {
name: 'PageAudiobooksArtists', name: 'PageAudiobookArtists',
components: { components: {
ContentWithHeading, ContentWithHeading,
ListIndexButtons, ListIndexButtons,

View File

@ -7,11 +7,11 @@ import PageArtist from '@/pages/PageArtist.vue'
import PageArtistSpotify from '@/pages/PageArtistSpotify.vue' import PageArtistSpotify from '@/pages/PageArtistSpotify.vue'
import PageArtistTracks from '@/pages/PageArtistTracks.vue' import PageArtistTracks from '@/pages/PageArtistTracks.vue'
import PageArtists from '@/pages/PageArtists.vue' import PageArtists from '@/pages/PageArtists.vue'
import PageAudiobooksAlbum from '@/pages/PageAudiobooksAlbum.vue' import PageAudiobookAlbum from '@/pages/PageAudiobookAlbum.vue'
import PageAudiobooksAlbums from '@/pages/PageAudiobooksAlbums.vue' import PageAudiobookAlbums from '@/pages/PageAudiobookAlbums.vue'
import PageAudiobooksArtist from '@/pages/PageAudiobooksArtist.vue' import PageAudiobookArtist from '@/pages/PageAudiobookArtist.vue'
import PageAudiobooksArtists from '@/pages/PageAudiobooksArtists.vue' import PageAudiobookArtists from '@/pages/PageAudiobookArtists.vue'
import PageAudiobooksGenres from '@/pages/PageAudiobooksGenres.vue' import PageAudiobookGenres from '@/pages/PageAudiobookGenres.vue'
import PageComposerAlbums from '@/pages/PageComposerAlbums.vue' import PageComposerAlbums from '@/pages/PageComposerAlbums.vue'
import PageComposerTracks from '@/pages/PageComposerTracks.vue' import PageComposerTracks from '@/pages/PageComposerTracks.vue'
import PageComposers from '@/pages/PageComposers.vue' import PageComposers from '@/pages/PageComposers.vue'
@ -79,34 +79,34 @@ export const router = createRouter({
path: '/music/artists/:id/tracks' path: '/music/artists/:id/tracks'
}, },
{ {
component: PageAudiobooksAlbum, component: PageAudiobookAlbum,
name: 'audiobooks-album', name: 'audiobook-album',
path: '/audiobooks/albums/:id' path: '/audiobook/albums/:id'
}, },
{ {
component: PageAudiobooksAlbums, component: PageAudiobookAlbums,
name: 'audiobooks-albums', name: 'audiobook-albums',
path: '/audiobooks/albums' path: '/audiobook/albums'
}, },
{ {
component: PageAudiobooksArtist, component: PageAudiobookArtist,
name: 'audiobooks-artist', name: 'audiobook-artist',
path: '/audiobooks/artists/:id' path: '/audiobook/artists/:id'
}, },
{ {
component: PageAudiobooksArtists, component: PageAudiobookArtists,
name: 'audiobooks-artists', name: 'audiobook-artists',
path: '/audiobooks/artists' path: '/audiobook/artists'
}, },
{ {
component: PageAudiobooksGenres, component: PageAudiobookGenres,
name: 'audiobooks-genres', name: 'audiobook-genres',
path: '/audiobooks/genres' path: '/audiobook/genres'
}, },
{ {
name: 'audiobooks', name: 'audiobooks',
path: '/audiobooks', path: '/audiobooks',
redirect: { name: 'audiobooks-artists' } redirect: { name: 'audiobook-artists' }
}, },
{ {
name: 'music', name: 'music',