[web] Use named route for audiobook albums and artists

Switching to named routes in order to reduce future maintenance.
This commit is contained in:
Alain Nussbaumer
2023-07-10 20:08:35 +02:00
parent 63586db7b6
commit d4a484f20e
9 changed files with 50 additions and 36 deletions

View File

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

View File

@@ -60,7 +60,10 @@ export default {
open_artist(artist) {
this.selected_artist = artist
if (this.media_kind_resolved === 'audiobook') {
this.$router.push({ path: '/audiobooks/artists/' + artist.id })
this.$router.push({
name: 'audiobooks-artist',
params: { id: artist.id }
})
} else {
this.$router.push({ path: '/music/artists/' + artist.id })
}

View File

@@ -160,7 +160,10 @@ export default {
if (this.media_kind_resolved === 'podcast') {
this.$router.push({ name: 'podcast', params: { id: this.album.id } })
} else if (this.media_kind_resolved === 'audiobook') {
this.$router.push({ name: 'audiobook', params: { id: this.album.id } })
this.$router.push({
name: 'audiobooks-album',
params: { id: this.album.id }
})
} else {
this.$router.push({ path: '/music/albums/' + this.album.id })
}
@@ -170,7 +173,8 @@ export default {
this.$emit('close')
if (this.media_kind_resolved === 'audiobook') {
this.$router.push({
path: '/audiobooks/artists/' + this.album.artist_id
name: 'audiobooks-artist',
params: { id: this.album.artist_id }
})
} else {
this.$router.push({ path: '/music/artists/' + this.album.artist_id })

View File

@@ -215,7 +215,7 @@ export default {
})
} else if (this.media_kind === 'audiobook') {
this.$router.push({
name: 'audiobook',
name: 'audiobooks-album',
params: { id: this.item.album_id }
})
} else {

View File

@@ -249,7 +249,7 @@ export default {
})
} else if (this.track.media_kind === 'audiobook') {
this.$router.push({
name: 'audiobook',
name: 'audiobooks-album',
params: { id: this.track.album_id }
})
} else {

View File

@@ -17,7 +17,7 @@
</navbar-item-link>
<navbar-item-link
v-if="is_visible_audiobooks"
:to="{ path: '/audiobooks' }"
:to="{ name: 'audiobooks' }"
>
<mdicon class="icon" name="book-open-variant" size="16" />
</navbar-item-link>
@@ -84,7 +84,7 @@
<mdicon class="icon" name="microphone" size="16" />
<b v-text="$t('navigation.podcasts')" />
</navbar-item-link>
<navbar-item-link :to="{ path: '/audiobooks' }">
<navbar-item-link :to="{ name: 'audiobooks' }">
<mdicon class="icon" name="book-open-variant" size="16" />
<b v-text="$t('navigation.audiobooks')" />
</navbar-item-link>