From 4c1388af5dddcbd2920272ac808c20f782c40873 Mon Sep 17 00:00:00 2001 From: ArneBo Date: Mon, 24 Mar 2025 14:34:37 +0100 Subject: [PATCH] fix(front): use artistCredit for admin pages, display artist credits in one line --- front/src/components/album/Card.vue | 1 - .../components/audio/ArtistCreditLabel.vue | 49 ++++++++++--------- front/src/components/common/ActorLink.vue | 10 ++-- .../components/manage/library/AlbumsTable.vue | 8 +-- .../components/manage/library/TracksTable.vue | 8 +-- front/src/views/admin/library/TrackDetail.vue | 8 +-- 6 files changed, 43 insertions(+), 41 deletions(-) diff --git a/front/src/components/album/Card.vue b/front/src/components/album/Card.vue index 66ea2ab47..b70d006a4 100644 --- a/front/src/components/album/Card.vue +++ b/front/src/components/album/Card.vue @@ -26,7 +26,6 @@ const props = defineProps() const { album } = props const artistCredit = album.artist_credit || [] -const firstArtist = artistCredit.length > 0 ? artistCredit[0].artist : null const store = useStore() const imageUrl = computed(() => props.album.cover?.urls.original diff --git a/front/src/components/audio/ArtistCreditLabel.vue b/front/src/components/audio/ArtistCreditLabel.vue index a4d35c65d..5a3eae81c 100644 --- a/front/src/components/audio/ArtistCreditLabel.vue +++ b/front/src/components/audio/ArtistCreditLabel.vue @@ -2,6 +2,7 @@ import type { ArtistCredit } from '~/types' import { useStore } from '~/store' +import Layout from '~/components/ui/Layout.vue' import Pill from '~/components/ui/Pill.vue' const store = useStore() @@ -23,28 +24,30 @@ const getRoute = (ac: ArtistCredit) => { diff --git a/front/src/components/common/ActorLink.vue b/front/src/components/common/ActorLink.vue index 002145b05..eecba8d01 100644 --- a/front/src/components/common/ActorLink.vue +++ b/front/src/components/common/ActorLink.vue @@ -39,15 +39,15 @@ const url = computed(() => { return { name: 'manage.moderation.accounts.detail', params: { id: actor.value.full_username } } } - if (actor.value.is_local) { - return { name: 'profile.overview', params: { username: actor.value.preferred_username } } + if (actor.value?.is_local) { + return { name: 'profile.overview', params: { username: actor.value?.preferred_username } } } return { name: 'profile.full.overview', params: { - username: actor.value.preferred_username, - domain: actor.value.domain + username: actor.value?.preferred_username, + domain: actor.value?.domain } } }) @@ -56,7 +56,7 @@ const url = computed(() => {