front:update playlist.id to playlist.uuid

This commit is contained in:
Petitminion 2025-04-27 12:31:38 +02:00
parent 1e0d4cbdcd
commit ed17ab35d2
9 changed files with 18 additions and 15 deletions

View File

@ -30,7 +30,7 @@ let navigate = (to: 'playlist' | 'user') => {}
if (import.meta.env.PROD) { if (import.meta.env.PROD) {
const router = useRouter() const router = useRouter()
navigate = (to: 'playlist' | 'user') => to === 'playlist' navigate = (to: 'playlist' | 'user') => to === 'playlist'
? router.push({ name: 'library.playlists.detail', params: { id: playlist.id } }) ? router.push({ name: 'library.playlists.detail', params: { id: playlist.uuid } })
: router.push({ name: 'profile.full', params: profileParams.value }) : router.push({ name: 'profile.full', params: profileParams.value })
} }
</script> </script>

View File

@ -68,7 +68,7 @@ const updatedAgo = computed(() => moment(props.playlist.modification_date).fromN
<template> <template>
<Card <Card
:title="playlist.name" :title="playlist.name"
:to="{ name: 'library.playlists.detail', params: { id: playlist.id } }" :to="{ name: 'library.playlists.detail', params: { id: playlist.uuid } }"
small small
> >
<template #topright> <template #topright>

View File

@ -14,7 +14,7 @@ defineProps<Props>()
<!-- TODO: Remove this module --> <!-- TODO: Remove this module -->
<PlaylistsCard <PlaylistsCard
v-for="playlist in playlists" v-for="playlist in playlists"
:key="playlist.id" :key="playlist.uuid"
:playlist="playlist" :playlist="playlist"
/> />
</template> </template>

View File

@ -40,7 +40,7 @@ const labels = computed(() => ({
})) }))
const exportUrl = computed(() => store.getters['instance/absoluteUrl'](`/api/v2/playlists/${props.playlist.id}`)) const exportUrl = computed(() => store.getters['instance/absoluteUrl'](`/api/v2/playlists/${props.playlist.uuid}`))
const exportPlaylist = async () => { const exportPlaylist = async () => {
const url = exportUrl.value const url = exportUrl.value
const authToken = store.state.auth.oauth.accessToken const authToken = store.state.auth.oauth.accessToken
@ -67,7 +67,7 @@ const router = useRouter()
const deletePlaylist = async () => { const deletePlaylist = async () => {
try { try {
await axios.delete(`playlists/${props.playlist.id}/`) await axios.delete(`playlists/${props.playlist.uuid}/`)
store.dispatch('playlists/fetchOwn') store.dispatch('playlists/fetchOwn')
return router.push({ path: '/library' }) return router.push({ path: '/library' })
} catch (error) { } catch (error) {
@ -161,7 +161,7 @@ const showDeleteModal = ref(false)
<div class="scrolling content"> <div class="scrolling content">
<div class="description"> <div class="description">
<embed-wizard <embed-wizard
:id="playlist.id" :id="playlist.uuid"
type="playlist" type="playlist"
/> />
</div> </div>

View File

@ -151,7 +151,10 @@ store.dispatch('playlists/fetchOwn')
> >
<thead> <thead>
<tr> <tr>
<th><span class="visually-hidden">{{ t('components.playlists.PlaylistModal.table.edit.header.edit') }}</span></th> <th>
<span class="visually-hidden">{{ t('components.playlists.PlaylistModal.table.edit.header.edit')
}}</span>
</th>
<th> <th>
{{ t('components.playlists.PlaylistModal.table.edit.header.name') }} {{ t('components.playlists.PlaylistModal.table.edit.header.name') }}
</th> </th>
@ -173,7 +176,7 @@ store.dispatch('playlists/fetchOwn')
solid solid
secondary secondary
square-small square-small
:to="{name: 'library.playlists.detail', params: {id: playlist.id }, query: {mode: 'edit'}}" :to="{ name: 'library.playlists.detail', params: { id: playlist.uuid }, query: { mode: 'edit' } }"
icon="bi-pencil-fill" icon="bi-pencil-fill"
> >
<span class="visually-hidden">{{ t('components.playlists.PlaylistModal.button.edit') }}</span> <span class="visually-hidden">{{ t('components.playlists.PlaylistModal.button.edit') }}</span>
@ -181,7 +184,7 @@ store.dispatch('playlists/fetchOwn')
</td> </td>
<td> <td>
<router-link <router-link
:to="{name: 'library.playlists.detail', params: {id: playlist.id }}" :to="{ name: 'library.playlists.detail', params: { id: playlist.uuid } }"
@click="store.state.playlists.showModal = false" @click="store.state.playlists.showModal = false"
> >
{{ playlist.name }} {{ playlist.name }}
@ -196,7 +199,7 @@ store.dispatch('playlists/fetchOwn')
primary primary
:title="labels.addToPlaylist" :title="labels.addToPlaylist"
icon="bi-plus" icon="bi-plus"
@click.prevent="addToPlaylist(playlist.id, false)" @click.prevent="addToPlaylist(playlist.uuid, false)"
> >
{{ t('components.playlists.PlaylistModal.button.addTrack') }} {{ t('components.playlists.PlaylistModal.button.addTrack') }}
</Button> </Button>

View File

@ -100,7 +100,7 @@ watch(
</Alert> </Alert>
<PlaylistCard <PlaylistCard
v-for="playlist in objects" v-for="playlist in objects"
:key="playlist.id" :key="playlist.uuid"
:playlist="playlist" :playlist="playlist"
/> />
</Section> </Section>

View File

@ -112,7 +112,7 @@ const getReportableObjects = ({ track, album, artist, artistCredit, playlist, ac
label: t('composables.moderation.useReport.playlist.label'), label: t('composables.moderation.useReport.playlist.label'),
target: { target: {
type: 'playlist', type: 'playlist',
id: playlist.id, id: playlist.uuid,
label: playlist.name, label: playlist.name,
_obj: playlist, _obj: playlist,
typeLabel: t('composables.moderation.useReport.playlist.typeLabel') typeLabel: t('composables.moderation.useReport.playlist.typeLabel')

View File

@ -277,7 +277,7 @@ const shuffle = () => {}
<div class="scrolling content"> <div class="scrolling content">
<div class="description"> <div class="description">
<embed-wizard <embed-wizard
:id="playlist.id" :id="playlist.uuid"
type="playlist" type="playlist"
/> />
</div> </div>

View File

@ -254,7 +254,7 @@ const paginateOptions = computed(() => sortedUniq([12, 30, 50, paginateBy.value]
/> />
<PlaylistsCard <PlaylistsCard
v-for="playlist in (result && result.results.length > 0 ? result.results : [])" v-for="playlist in (result && result.results.length > 0 ? result.results : [])"
:key="playlist.id" :key="playlist.uuid"
:playlist="playlist" :playlist="playlist"
/> />
<Spacer grow /> <Spacer grow />