[web] Use named route for the podcasts page

Switching to named routes in order to reduce future maintenance.
This commit is contained in:
Alain Nussbaumer 2023-07-10 13:09:27 +02:00
parent f09647d754
commit 44d488467e
3 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,7 @@
<navbar-item-link v-if="is_visible_music" :to="{ path: '/music' }"> <navbar-item-link v-if="is_visible_music" :to="{ path: '/music' }">
<mdicon class="icon" name="music" size="16" /> <mdicon class="icon" name="music" size="16" />
</navbar-item-link> </navbar-item-link>
<navbar-item-link v-if="is_visible_podcasts" :to="{ path: '/podcasts' }"> <navbar-item-link v-if="is_visible_podcasts" :to="{ name: 'podcasts' }">
<mdicon class="icon" name="microphone" size="16" /> <mdicon class="icon" name="microphone" size="16" />
</navbar-item-link> </navbar-item-link>
<navbar-item-link <navbar-item-link
@ -83,7 +83,7 @@
> >
<span class="pl-5" v-text="$t('navigation.spotify')" /> <span class="pl-5" v-text="$t('navigation.spotify')" />
</navbar-item-link> </navbar-item-link>
<navbar-item-link :to="{ path: '/podcasts' }"> <navbar-item-link :to="{ name: 'podcasts' }">
<mdicon class="icon" name="microphone" size="16" /> <mdicon class="icon" name="microphone" size="16" />
<b v-text="$t('navigation.podcasts')" /> <b v-text="$t('navigation.podcasts')" />
</navbar-item-link> </navbar-item-link>

View File

@ -139,7 +139,7 @@ export default {
webapi webapi
.library_playlist_delete(this.rss_playlist_to_remove.id) .library_playlist_delete(this.rss_playlist_to_remove.id)
.then(() => { .then(() => {
this.$router.replace({ path: '/podcasts' }) this.$router.replace({ name: 'podcasts' })
}) })
}, },

View File

@ -3,8 +3,10 @@ import { createRouter, createWebHashHistory } from 'vue-router'
import PageAbout from '@/pages/PageAbout.vue' import PageAbout from '@/pages/PageAbout.vue'
import PageAudiobooksAlbum from '@/pages/PageAudiobooksAlbum.vue' import PageAudiobooksAlbum from '@/pages/PageAudiobooksAlbum.vue'
import PageAudiobooksAlbums from '@/pages/PageAudiobooksAlbums.vue' import PageAudiobooksAlbums from '@/pages/PageAudiobooksAlbums.vue'
import PageQueue from '@/pages/PageQueue.vue' import PagePodcast from '@/pages/PagePodcast.vue'
import PagePodcasts from '@/pages/PagePodcasts.vue'
import PageNowPlaying from '@/pages/PageNowPlaying.vue' import PageNowPlaying from '@/pages/PageNowPlaying.vue'
import PageQueue from '@/pages/PageQueue.vue'
import PageBrowse from '@/pages/PageBrowse.vue' import PageBrowse from '@/pages/PageBrowse.vue'
import PageBrowseRecentlyAdded from '@/pages/PageBrowseRecentlyAdded.vue' import PageBrowseRecentlyAdded from '@/pages/PageBrowseRecentlyAdded.vue'
import PageBrowseRecentlyPlayed from '@/pages/PageBrowseRecentlyPlayed.vue' import PageBrowseRecentlyPlayed from '@/pages/PageBrowseRecentlyPlayed.vue'
@ -19,8 +21,6 @@ import PageArtistTracks from '@/pages/PageArtistTracks.vue'
import PageComposers from '@/pages/PageComposers.vue' import PageComposers from '@/pages/PageComposers.vue'
import PageComposer from '@/pages/PageComposer.vue' import PageComposer from '@/pages/PageComposer.vue'
import PageComposerTracks from '@/pages/PageComposerTracks.vue' import PageComposerTracks from '@/pages/PageComposerTracks.vue'
import PagePodcast from '@/pages/PagePodcast.vue'
import PagePodcasts from '@/pages/PagePodcasts.vue'
import PageAudiobooksArtists from '@/pages/PageAudiobooksArtists.vue' import PageAudiobooksArtists from '@/pages/PageAudiobooksArtists.vue'
import PageAudiobooksArtist from '@/pages/PageAudiobooksArtist.vue' import PageAudiobooksArtist from '@/pages/PageAudiobooksArtist.vue'
import PagePlaylists from '@/pages/PagePlaylists.vue' import PagePlaylists from '@/pages/PagePlaylists.vue'
@ -155,10 +155,10 @@ export const router = createRouter({
path: '/podcast/:id' path: '/podcast/:id'
}, },
{ {
path: '/podcasts',
name: 'Podcasts',
component: PagePodcasts, component: PagePodcasts,
meta: { show_progress: true } meta: { show_progress: true },
name: 'podcasts',
path: '/podcasts',
}, },
{ {
path: '/audiobooks', path: '/audiobooks',