mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-15 08:45:02 -05:00
[web] Use named route for music albums
Switching to named routes in order to reduce future maintenance.
This commit is contained in:
parent
60374c2f47
commit
d0fbd68523
@ -112,7 +112,7 @@ export default {
|
|||||||
params: { id: album.id }
|
params: { id: album.id }
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({ path: '/music/albums/' + album.id })
|
this.$router.push({ name: 'music-album', params: { id: album.id } })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -165,7 +165,10 @@ export default {
|
|||||||
params: { id: this.album.id }
|
params: { id: this.album.id }
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({ path: '/music/albums/' + this.album.id })
|
this.$router.push({
|
||||||
|
name: 'music-album',
|
||||||
|
params: { id: this.album.id }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -166,8 +166,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import webapi from '@/webapi'
|
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogQueueItem',
|
name: 'ModalDialogQueueItem',
|
||||||
@ -219,7 +219,10 @@ export default {
|
|||||||
params: { id: this.item.album_id }
|
params: { id: this.item.album_id }
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({ path: '/music/albums/' + this.item.album_id })
|
this.$router.push({
|
||||||
|
name: 'music-album',
|
||||||
|
params: { id: this.item.album_id }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -193,8 +193,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import webapi from '@/webapi'
|
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogTrack',
|
name: 'ModalDialogTrack',
|
||||||
@ -253,7 +253,10 @@ export default {
|
|||||||
params: { id: this.track.album_id }
|
params: { id: this.track.album_id }
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({ path: '/music/albums/' + this.track.album_id })
|
this.$router.push({
|
||||||
|
name: 'music-album',
|
||||||
|
params: { id: this.track.album_id }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
<navbar-item-link :to="{ name: 'music-artists' }">
|
<navbar-item-link :to="{ name: 'music-artists' }">
|
||||||
<span class="pl-5" v-text="$t('navigation.artists')" />
|
<span class="pl-5" v-text="$t('navigation.artists')" />
|
||||||
</navbar-item-link>
|
</navbar-item-link>
|
||||||
<navbar-item-link :to="{ path: '/music/albums' }">
|
<navbar-item-link :to="{ name: 'music-albums' }">
|
||||||
<span class="pl-5" v-text="$t('navigation.albums')" />
|
<span class="pl-5" v-text="$t('navigation.albums')" />
|
||||||
</navbar-item-link>
|
</navbar-item-link>
|
||||||
<navbar-item-link :to="{ path: '/music/genres' }">
|
<navbar-item-link :to="{ path: '/music/genres' }">
|
||||||
|
@ -55,8 +55,8 @@ import webapi from '@/webapi'
|
|||||||
const dataObject = {
|
const dataObject = {
|
||||||
load(to) {
|
load(to) {
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
webapi.library_album(to.params.album_id),
|
webapi.library_album(to.params.id),
|
||||||
webapi.library_album_tracks(to.params.album_id)
|
webapi.library_album_tracks(to.params.id)
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -49,7 +49,18 @@ export const router = createRouter({
|
|||||||
name: 'about',
|
name: 'about',
|
||||||
path: '/about'
|
path: '/about'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: PageAlbum,
|
||||||
|
meta: { show_progress: true },
|
||||||
|
name: 'music-album',
|
||||||
|
path: '/music/albums/:id'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: PageAlbums,
|
||||||
|
meta: { has_index: true, has_tabs: true, show_progress: true },
|
||||||
|
name: 'music-albums',
|
||||||
|
path: '/music/albums'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
component: PageArtist,
|
component: PageArtist,
|
||||||
meta: { show_progress: true, has_index: true },
|
meta: { show_progress: true, has_index: true },
|
||||||
@ -119,18 +130,6 @@ export const router = createRouter({
|
|||||||
component: PageBrowseRecentlyPlayed,
|
component: PageBrowseRecentlyPlayed,
|
||||||
meta: { show_progress: true, has_tabs: true }
|
meta: { show_progress: true, has_tabs: true }
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/music/albums',
|
|
||||||
name: 'Albums',
|
|
||||||
component: PageAlbums,
|
|
||||||
meta: { show_progress: true, has_tabs: true, has_index: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/music/albums/:album_id',
|
|
||||||
name: 'Album',
|
|
||||||
component: PageAlbum,
|
|
||||||
meta: { show_progress: true }
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
component: PageFiles,
|
component: PageFiles,
|
||||||
meta: { show_progress: true },
|
meta: { show_progress: true },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user