fix(front): use artistCredit for admin pages, display artist credits in one line
This commit is contained in:
parent
30747bab66
commit
4c1388af5d
|
@ -26,7 +26,6 @@ const props = defineProps<Props>()
|
||||||
const { album } = props
|
const { album } = props
|
||||||
|
|
||||||
const artistCredit = album.artist_credit || []
|
const artistCredit = album.artist_credit || []
|
||||||
const firstArtist = artistCredit.length > 0 ? artistCredit[0].artist : null
|
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const imageUrl = computed(() => props.album.cover?.urls.original
|
const imageUrl = computed(() => props.album.cover?.urls.original
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import type { ArtistCredit } from '~/types'
|
import type { ArtistCredit } from '~/types'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
import Layout from '~/components/ui/Layout.vue'
|
||||||
import Pill from '~/components/ui/Pill.vue'
|
import Pill from '~/components/ui/Pill.vue'
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
@ -23,6 +24,7 @@ const getRoute = (ac: ArtistCredit) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<Layout flex>
|
||||||
<template
|
<template
|
||||||
v-for="ac in props.artistCredit"
|
v-for="ac in props.artistCredit"
|
||||||
:key="ac.artist.id"
|
:key="ac.artist.id"
|
||||||
|
@ -47,4 +49,5 @@ const getRoute = (ac: ArtistCredit) => {
|
||||||
</Pill>
|
</Pill>
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
</Layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -39,15 +39,15 @@ const url = computed(() => {
|
||||||
return { name: 'manage.moderation.accounts.detail', params: { id: actor.value.full_username } }
|
return { name: 'manage.moderation.accounts.detail', params: { id: actor.value.full_username } }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actor.value.is_local) {
|
if (actor.value?.is_local) {
|
||||||
return { name: 'profile.overview', params: { username: actor.value.preferred_username } }
|
return { name: 'profile.overview', params: { username: actor.value?.preferred_username } }
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'profile.full.overview',
|
name: 'profile.full.overview',
|
||||||
params: {
|
params: {
|
||||||
username: actor.value.preferred_username,
|
username: actor.value?.preferred_username,
|
||||||
domain: actor.value.domain
|
domain: actor.value?.domain
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -56,7 +56,7 @@ const url = computed(() => {
|
||||||
<template>
|
<template>
|
||||||
<Link
|
<Link
|
||||||
:to="url"
|
:to="url"
|
||||||
:title="actor.full_username"
|
:title="actor?.full_username"
|
||||||
class="username"
|
class="username"
|
||||||
:solid="!discrete"
|
:solid="!discrete"
|
||||||
:secondary="!discrete"
|
:secondary="!discrete"
|
||||||
|
|
|
@ -194,16 +194,16 @@ const labels = computed(() => ({
|
||||||
</router-link>
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<router-link :to="{name: 'manage.library.artists.detail', params: {id: scope.obj.artist.id }}">
|
<router-link :to="{name: 'manage.library.artists.detail', params: {id: scope.obj.artist_credit[0].artist.id }}">
|
||||||
<i class="wrench icon" />
|
<i class="wrench icon" />
|
||||||
<span class="visually-hidden">{{ labels.openModeration }}</span>
|
<span class="visually-hidden">{{ labels.openModeration }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
<a
|
<a
|
||||||
href=""
|
href=""
|
||||||
class="discrete link"
|
class="discrete link"
|
||||||
:title="scope.obj.artist.name"
|
:title="scope.obj.artist_credit[0].artist.name"
|
||||||
@click.prevent="addSearchToken('artist', scope.obj.artist.name)"
|
@click.prevent="addSearchToken('artist', scope.obj.artist_credit[0].artist.name)"
|
||||||
>{{ scope.obj.artist.name }}</a>
|
>{{ scope.obj.artist_credit[0].artist.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<template v-if="!scope.obj.is_local">
|
<template v-if="!scope.obj.is_local">
|
||||||
|
|
|
@ -205,15 +205,15 @@ const labels = computed(() => ({
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<router-link :to="{name: 'manage.library.artists.detail', params: {id: scope.obj.artist.id }}">
|
<router-link :to="{name: 'manage.library.artists.detail', params: {id: scope.obj.artist_credit[0].artist.id }}">
|
||||||
<i class="wrench icon" />
|
<i class="wrench icon" />
|
||||||
</router-link>
|
</router-link>
|
||||||
<a
|
<a
|
||||||
href=""
|
href=""
|
||||||
class="discrete link"
|
class="discrete link"
|
||||||
:title="scope.obj.artist.name"
|
:title="scope.obj.artist_credit[0].artist.name"
|
||||||
@click.prevent="addSearchToken('artist_id', scope.obj.artist.id)"
|
@click.prevent="addSearchToken('artist_id', scope.obj.artist_credit[0].artist.id)"
|
||||||
>{{ scope.obj.artist.name }}</a>
|
>{{ scope.obj.artist_credit[0].artist.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<template v-if="!scope.obj.is_local">
|
<template v-if="!scope.obj.is_local">
|
||||||
|
|
|
@ -246,22 +246,22 @@ const getQuery = (field: string, value: string) => `${field}:"${value}"`
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<router-link :to="{name: 'manage.library.artists.detail', params: {id: track.artist.id }}">
|
<router-link :to="{name: 'manage.library.artists.detail', params: {id: track.artist_credit[0].artist.id }}">
|
||||||
{{ t('views.admin.library.TrackDetail.link.artist') }}
|
{{ t('views.admin.library.TrackDetail.link.artist') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ track.artist.name }}
|
{{ track.artist_credit[0].artist.name }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="track.album">
|
<tr v-if="track.album">
|
||||||
<td>
|
<td>
|
||||||
<router-link :to="{name: 'manage.library.artists.detail', params: {id: track.album.artist.id }}">
|
<router-link :to="{name: 'manage.library.artists.detail', params: {id: track.album.artist_credit[0].artist.id }}">
|
||||||
{{ t('views.admin.library.TrackDetail.link.albumArtist') }}
|
{{ t('views.admin.library.TrackDetail.link.albumArtist') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ track.album.artist.name }}
|
{{ track.album.artist_credit[0].artist.name }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue