mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-12 17:14:37 +08:00
fix: 修正订阅卡片占位符样式和媒体 ID 校验逻辑
This commit is contained in:
@@ -540,7 +540,7 @@ function handleCardClick() {
|
||||
<template #image v-if="display.smAndUp.value">
|
||||
<div
|
||||
v-if="showPlaceholder"
|
||||
class="subscribe-card-placeholder d-flex align-center justify-center relative"
|
||||
class="subscribe-card-placeholder subscribe-card-placeholder--cover d-flex align-center justify-center relative"
|
||||
>
|
||||
<VIcon :icon="placeholderIcon" size="64" color="medium-emphasis" />
|
||||
<div class="absolute inset-0 outline-none subscribe-card-background"></div>
|
||||
@@ -675,7 +675,7 @@ function handleCardClick() {
|
||||
</template>
|
||||
|
||||
<div v-else>
|
||||
<VCardText class="flex items-center pt-3 pb-2">
|
||||
<VCardText class="flex flex-1 items-center pt-3 pb-9">
|
||||
<div
|
||||
class="h-auto w-12 flex-shrink-0 overflow-hidden rounded-md relative"
|
||||
v-if="imageLoaded && posterUrl"
|
||||
@@ -699,7 +699,7 @@ function handleCardClick() {
|
||||
</div>
|
||||
</div>
|
||||
</VCardText>
|
||||
<VCardText class="flex min-w-0 justify-space-between align-center flex-wrap px-3 mt-auto">
|
||||
<VCardText class="absolute inset-x-0 bottom-2 z-10 flex min-w-0 justify-space-between align-center flex-wrap px-3">
|
||||
<div class="flex min-w-0 max-w-full align-center">
|
||||
<VIcon
|
||||
v-if="props.media?.total_episode && props.sortable"
|
||||
@@ -981,6 +981,11 @@ function handleCardClick() {
|
||||
background: rgba(var(--v-theme-on-surface), 0.08);
|
||||
}
|
||||
|
||||
/* 桌面版占位与图片同高,避免无图时卡片整体塌陷上浮 */
|
||||
.subscribe-card-placeholder--cover {
|
||||
aspect-ratio: 3 / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停:降低不透明度表达"已停止活动"
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import type { MediaDataSource } from '@/api/types'
|
||||
|
||||
const MUSICBRAINZ_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
|
||||
const MUSICBRAINZ_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
|
||||
|
||||
/** 按媒体数据源校验原生 ID,MusicBrainz 使用 UUID,其它现有来源使用数字 ID。 */
|
||||
export function isValidMediaSourceId(value: string | number | null | undefined, source?: MediaDataSource): boolean {
|
||||
const normalized = value?.toString().trim()
|
||||
if (!normalized) return true
|
||||
if (source === 'musicbrainz') return MUSICBRAINZ_ID_PATTERN.test(normalized)
|
||||
// 无媒体上下文或来源为非 MusicBrainz 时,UUID 形态同样按 MusicBrainz ID 放行
|
||||
if (source === 'musicbrainz' || MUSICBRAINZ_ID_PATTERN.test(normalized)) {
|
||||
return MUSICBRAINZ_ID_PATTERN.test(normalized)
|
||||
}
|
||||
return /^\d+$/.test(normalized)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user