From 845f111c29a0efd57728fc9dd84fc67c7de61295 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Wed, 12 Jul 2023 21:30:52 +0200 Subject: [PATCH] [web] Use named route for Spotify pages Switching to named routes in order to reduce future maintenance. --- .../src/components/ModalDialogQueueItem.vue | 6 +- web-src/src/components/ModalDialogTrack.vue | 6 +- web-src/src/components/NavbarTop.vue | 2 +- .../src/components/SpotifyListItemArtist.vue | 5 +- .../components/SpotifyModalDialogAlbum.vue | 10 ++- .../components/SpotifyModalDialogArtist.vue | 5 +- .../components/SpotifyModalDialogTrack.vue | 8 ++- web-src/src/components/TabsMusic.vue | 2 +- ...tifyPageAlbum.vue => PageAlbumSpotify.vue} | 13 ++-- ...fyPageArtist.vue => PageArtistSpotify.vue} | 19 ++--- ...fyPageBrowse.vue => PageBrowseSpotify.vue} | 9 ++- ...=> PageBrowseSpotifyFeaturedPlaylists.vue} | 0 ...s.vue => PageBrowseSpotifyNewReleases.vue} | 9 ++- web-src/src/pages/PageSearchSpotify.vue | 5 +- web-src/src/router/index.js | 71 +++++++++---------- 15 files changed, 100 insertions(+), 70 deletions(-) rename web-src/src/pages/{SpotifyPageAlbum.vue => PageAlbumSpotify.vue} (95%) rename web-src/src/pages/{SpotifyPageArtist.vue => PageArtistSpotify.vue} (95%) rename web-src/src/pages/{SpotifyPageBrowse.vue => PageBrowseSpotify.vue} (96%) rename web-src/src/pages/{SpotifyPageBrowseFeaturedPlaylists.vue => PageBrowseSpotifyFeaturedPlaylists.vue} (100%) rename web-src/src/pages/{SpotifyPageBrowseNewReleases.vue => PageBrowseSpotifyNewReleases.vue} (96%) diff --git a/web-src/src/components/ModalDialogQueueItem.vue b/web-src/src/components/ModalDialogQueueItem.vue index 4bb04b9c..eece47eb 100644 --- a/web-src/src/components/ModalDialogQueueItem.vue +++ b/web-src/src/components/ModalDialogQueueItem.vue @@ -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 } }) } } diff --git a/web-src/src/components/ModalDialogTrack.vue b/web-src/src/components/ModalDialogTrack.vue index 86124fd8..7ed77718 100644 --- a/web-src/src/components/ModalDialogTrack.vue +++ b/web-src/src/components/ModalDialogTrack.vue @@ -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 } }) }, diff --git a/web-src/src/components/NavbarTop.vue b/web-src/src/components/NavbarTop.vue index 758a444e..1cc0bce5 100644 --- a/web-src/src/components/NavbarTop.vue +++ b/web-src/src/components/NavbarTop.vue @@ -76,7 +76,7 @@ diff --git a/web-src/src/components/SpotifyListItemArtist.vue b/web-src/src/components/SpotifyListItemArtist.vue index fa28e8a3..f012ff4c 100644 --- a/web-src/src/components/SpotifyListItemArtist.vue +++ b/web-src/src/components/SpotifyListItemArtist.vue @@ -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 } + }) } } } diff --git a/web-src/src/components/SpotifyModalDialogAlbum.vue b/web-src/src/components/SpotifyModalDialogAlbum.vue index 663a8598..33d515fc 100644 --- a/web-src/src/components/SpotifyModalDialogAlbum.vue +++ b/web-src/src/components/SpotifyModalDialogAlbum.vue @@ -88,8 +88,8 @@