From 501cca2fd63771c80855f47e2ed1a36d703bae07 Mon Sep 17 00:00:00 2001 From: ThrRip Date: Thu, 11 Jan 2024 18:15:40 +0800 Subject: [PATCH] admin: Fix that failed publishes are not properly displayed --- packages/admin/components/PlaylistList.vue | 102 +++++++++++++++++---- 1 file changed, 85 insertions(+), 17 deletions(-) diff --git a/packages/admin/components/PlaylistList.vue b/packages/admin/components/PlaylistList.vue index 60bdbc5..6a5cce4 100644 --- a/packages/admin/components/PlaylistList.vue +++ b/packages/admin/components/PlaylistList.vue @@ -203,7 +203,11 @@ grid-rows-1 portrait:grid-rows-[auto_auto]" :class="{ 'bg-blue-l/50 rounded-xl': props.type === 'changes' && ( - (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? !getPublishingStateById(song.$id)?.old : !getUnmodifiedSongById(song.$id) ) && @@ -327,26 +331,42 @@ > {{ props.type === 'main' || ( props.type === 'changes' && ( - (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.name === song.name : getUnmodifiedSongById(song.$id)?.name === song.name ) ) ? song.name : '' }} - {{ (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + {{ ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.name : getUnmodifiedSongById(song.$id)?.name }} @@ -391,26 +411,42 @@ > {{ props.type === 'main' || ( props.type === 'changes' && ( - (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.artist === song.artist : getUnmodifiedSongById(song.$id)?.artist === song.artist ) ) ? song.artist : '' }} - {{ (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + {{ ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.artist : getUnmodifiedSongById(song.$id)?.artist }} @@ -470,26 +506,42 @@ > {{ props.type === 'main' || ( props.type === 'changes' && song.payment_amount && ( - (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.payment_amount === song.payment_amount : getUnmodifiedSongById(song.$id)?.payment_amount === song.payment_amount ) ) ? `¥${song.payment_amount}` : '' }} - ¥{{ (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + ¥{{ ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.payment_amount : getUnmodifiedSongById(song.$id)?.payment_amount }} @@ -534,26 +586,42 @@ > {{ props.type === 'main' || ( props.type === 'changes' && ( - (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.language === song.language : getUnmodifiedSongById(song.$id)?.language === song.language ) ) ? song.language : '' }} - {{ (getPublishingStateById(song.$id) && getPublishingStateById(song.$id)?.state !== 'processing') ? + {{ ( + getPublishingStateById(song.$id) && + getPublishingStateById(song.$id)?.state !== 'processing' && + getPublishingStateById(song.$id)?.state !== 'failed' + ) ? getPublishingStateById(song.$id)?.old?.language : getUnmodifiedSongById(song.$id)?.language }}