[web] Use named route for Spotify pages

Switching to named routes in order to reduce future maintenance.
This commit is contained in:
Alain Nussbaumer
2023-07-12 21:30:52 +02:00
parent 2bec9e1886
commit 845f111c29
15 changed files with 100 additions and 70 deletions

View File

@@ -243,14 +243,16 @@ export default {
open_spotify_artist() {
this.$emit('close')
this.$router.push({
path: '/music/spotify/artists/' + this.spotify_track.artists[0].id
name: 'music-spotify-artist',
params: { id: this.spotify_track.artists[0].id }
})
},
open_spotify_album() {
this.$emit('close')
this.$router.push({
path: '/music/spotify/albums/' + this.spotify_track.album.id
name: 'music-spotify-album',
params: { id: this.spotify_track.album.id }
})
}
}

View File

@@ -278,14 +278,16 @@ export default {
open_spotify_artist() {
this.$emit('close')
this.$router.push({
path: '/music/spotify/artists/' + this.spotify_track.artists[0].id
name: 'music-spotify-artist',
params: { id: this.spotify_track.artists[0].id }
})
},
open_spotify_album() {
this.$emit('close')
this.$router.push({
path: '/music/spotify/albums/' + this.spotify_track.album.id
name: 'music-spotify-album',
params: { id: this.spotify_track.album.id }
})
},

View File

@@ -76,7 +76,7 @@
</navbar-item-link>
<navbar-item-link
v-if="spotify_enabled"
:to="{ path: '/music/spotify' }"
:to="{ name: 'music-spotify' }"
>
<span class="pl-5" v-text="$t('navigation.spotify')" />
</navbar-item-link>

View File

@@ -16,7 +16,10 @@ export default {
methods: {
open_artist() {
this.$router.push({ path: '/music/spotify/artists/' + this.artist.id })
this.$router.push({
name: 'music-spotify-artist',
params: { id: this.artist.id }
})
}
}
}

View File

@@ -88,8 +88,8 @@
</template>
<script>
import webapi from '@/webapi'
import CoverArtwork from '@/components/CoverArtwork.vue'
import webapi from '@/webapi'
export default {
name: 'SpotifyModalDialogAlbum',
@@ -129,12 +129,16 @@ export default {
},
open_album() {
this.$router.push({ path: '/music/spotify/albums/' + this.album.id })
this.$router.push({
name: 'music-spotify-album',
params: { id: this.album.id }
})
},
open_artist() {
this.$router.push({
path: '/music/spotify/artists/' + this.album.artists[0].id
name: 'music-spotify-artist',
params: { id: this.album.artists[0].id }
})
},

View File

@@ -95,7 +95,10 @@ export default {
},
open_artist() {
this.$router.push({ path: '/music/spotify/artists/' + this.artist.id })
this.$router.push({
name: 'music-spotify-artist',
params: { id: this.artist.id }
})
}
}
}

View File

@@ -130,12 +130,16 @@ export default {
},
open_album() {
this.$router.push({ path: '/music/spotify/albums/' + this.album.id })
this.$router.push({
name: 'music-spotify-album',
params: { id: this.album.id }
})
},
open_artist() {
this.$router.push({
path: '/music/spotify/artists/' + this.album.artists[0].id
name: 'music-spotify-artist',
params: { id: this.album.artists[0].id }
})
}
}

View File

@@ -76,7 +76,7 @@
<router-link
v-if="spotify_enabled"
v-slot="{ navigate, isActive }"
to="/music/spotify"
:to="{ name: 'music-spotify' }"
custom
>
<li :class="{ 'is-active': isActive }">