mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-07 04:42:58 -05:00
[web] Use named route for playlist pages
Switching to named routes in order to reduce future maintenance.
This commit is contained in:
@@ -12,13 +12,14 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SpotifyListItemPlaylist',
|
||||
name: 'ListItemPlaylistSpotify',
|
||||
props: ['playlist'],
|
||||
|
||||
methods: {
|
||||
open_playlist() {
|
||||
this.$router.push({
|
||||
path: '/music/spotify/playlists/' + this.playlist.id
|
||||
name: 'playlist-spotify',
|
||||
params: { id: this.playlist.id }
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -46,9 +46,12 @@ export default {
|
||||
methods: {
|
||||
open_playlist(playlist) {
|
||||
if (playlist.type !== 'folder') {
|
||||
this.$router.push({ path: '/playlists/' + playlist.id + '/tracks' })
|
||||
this.$router.push({
|
||||
name: 'playlist-tracks',
|
||||
params: { id: playlist.id }
|
||||
})
|
||||
} else {
|
||||
this.$router.push({ path: '/playlists/' + playlist.id })
|
||||
this.$router.push({ name: 'playlist', params: { id: playlist.id } })
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -89,7 +89,10 @@ export default {
|
||||
|
||||
open_playlist() {
|
||||
this.$emit('close')
|
||||
this.$router.push({ path: '/playlists/' + this.playlist.id + '/tracks' })
|
||||
this.$router.push({
|
||||
name: 'playlist-tracks',
|
||||
params: { id: this.playlist.id }
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
import webapi from '@/webapi'
|
||||
|
||||
export default {
|
||||
name: 'SpotifyModalDialogPlaylist',
|
||||
name: 'ModalDialogPlaylistSpotify',
|
||||
props: ['show', 'playlist'],
|
||||
emits: ['close'],
|
||||
|
||||
@@ -100,8 +100,10 @@ export default {
|
||||
},
|
||||
|
||||
open_playlist() {
|
||||
this.$emit('close')
|
||||
this.$router.push({
|
||||
path: '/music/spotify/playlists/' + this.playlist.id
|
||||
name: 'playlist-spotify',
|
||||
params: { id: this.playlist.id }
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,7 @@
|
||||
aria-label="main navigation"
|
||||
>
|
||||
<div class="navbar-brand">
|
||||
<navbar-item-link
|
||||
v-if="is_visible_playlists"
|
||||
:to="{ path: '/playlists' }"
|
||||
>
|
||||
<navbar-item-link v-if="is_visible_playlists" :to="{ name: 'playlists' }">
|
||||
<mdicon class="icon" name="music-box-multiple" size="16" />
|
||||
</navbar-item-link>
|
||||
<navbar-item-link v-if="is_visible_music" :to="{ path: '/music' }">
|
||||
@@ -60,7 +57,7 @@
|
||||
/>
|
||||
</a>
|
||||
<div class="navbar-dropdown is-right">
|
||||
<navbar-item-link :to="{ path: '/playlists' }">
|
||||
<navbar-item-link :to="{ name: 'playlists' }">
|
||||
<mdicon class="icon" name="music-box-multiple" size="16" />
|
||||
<b v-text="$t('navigation.playlists')" />
|
||||
</navbar-item-link>
|
||||
|
||||
Reference in New Issue
Block a user