[web] Use named route for audiobook albums

Switching to named routes in order to reduce future maintenance.
This commit is contained in:
Alain Nussbaumer
2023-07-10 09:52:52 +02:00
parent 5c573f7138
commit 72c5172f12
6 changed files with 26 additions and 20 deletions

View File

@@ -69,13 +69,13 @@
<script>
import CoverArtwork from '@/components/CoverArtwork.vue'
import ModalDialogAlbum from '@/components/ModalDialogAlbum.vue'
import ModalDialog from '@/components/ModalDialog.vue'
import ModalDialogAlbum from '@/components/ModalDialogAlbum.vue'
import webapi from '@/webapi'
export default {
name: 'ListAlbums',
components: { CoverArtwork, ModalDialogAlbum, ModalDialog },
components: { CoverArtwork, ModalDialog, ModalDialogAlbum },
props: ['albums', 'media_kind', 'hide_group_title'],
emits: ['play-count-changed', 'podcast-deleted'],
@@ -107,7 +107,7 @@ export default {
if (this.media_kind_resolved === 'podcast') {
this.$router.push({ path: '/podcasts/' + album.id })
} else if (this.media_kind_resolved === 'audiobook') {
this.$router.push({ path: '/audiobooks/' + album.id })
this.$router.push({ name: 'audiobook', params: { id: album.id } })
} else {
this.$router.push({ path: '/music/albums/' + album.id })
}

View File

@@ -160,7 +160,7 @@ export default {
if (this.media_kind_resolved === 'podcast') {
this.$router.push({ path: '/podcasts/' + this.album.id })
} else if (this.media_kind_resolved === 'audiobook') {
this.$router.push({ path: '/audiobooks/' + this.album.id })
this.$router.push({ name: 'audiobook', params: { id: this.album.id } })
} else {
this.$router.push({ path: '/music/albums/' + this.album.id })
}

View File

@@ -211,7 +211,10 @@ export default {
if (this.media_kind === 'podcast') {
this.$router.push({ path: '/podcasts/' + this.item.album_id })
} else if (this.media_kind === 'audiobook') {
this.$router.push({ path: '/audiobooks/' + this.item.album_id })
this.$router.push({
name: 'audiobook',
params: { id: this.item.album_id }
})
} else {
this.$router.push({ path: '/music/albums/' + this.item.album_id })
}

View File

@@ -245,7 +245,10 @@ export default {
if (this.track.media_kind === 'podcast') {
this.$router.push({ path: '/podcasts/' + this.track.album_id })
} else if (this.track.media_kind === 'audiobook') {
this.$router.push({ path: '/audiobooks/' + this.track.album_id })
this.$router.push({
name: 'audiobook',
params: { id: this.track.album_id }
})
} else {
this.$router.push({ path: '/music/albums/' + this.track.album_id })
}