diff --git a/src/components/cache/RecognitionCachePanel.vue b/src/components/cache/RecognitionCachePanel.vue index 58568d4a..932a6fe1 100644 --- a/src/components/cache/RecognitionCachePanel.vue +++ b/src/components/cache/RecognitionCachePanel.vue @@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n' import api from '@/api' import type { ApiResponse, RecognitionCacheData, RecognitionCacheItem } from '@/api/types' import { useConfirm } from '@/composables/useConfirm' +import ProgressiveCardGrid from '@/components/misc/ProgressiveCardGrid.vue' import { useGlobalSettingsStore } from '@/stores' import { getDisplayImageUrl } from '@/utils/imageUtils' @@ -13,7 +14,6 @@ type InfiniteScrollStatus = 'ok' | 'empty' | 'loading' | 'error' type RecognitionCacheSource = 'tmdb' | 'douban' const MOBILE_CACHE_PAGE_SIZE = 20 -const MOBILE_CACHE_ITEM_HEIGHT = 144 const { t } = useI18n() const display = useDisplay() @@ -74,8 +74,7 @@ const filteredData = computed(() => { !keyword || [item.key, item.title, item.year, getRecognitionId(item)].some(value => value.toLowerCase().includes(keyword)) const matchesStatus = - statusFilter.value === 'all' || - (statusFilter.value === 'recognized' ? isRecognized(item) : !isRecognized(item)) + statusFilter.value === 'all' || (statusFilter.value === 'recognized' ? isRecognized(item) : !isRecognized(item)) return matchesKeyword && matchesStatus }) }) @@ -155,7 +154,9 @@ async function clearAllCache() { /** 请求当前识别数据源接口删除指定识别缓存。 */ async function deleteCacheItem(key: string) { - const response = (await api.delete(`${recognitionCacheEndpoint.value}/${encodeURIComponent(key)}`)) as unknown as ApiResponse + const response = (await api.delete( + `${recognitionCacheEndpoint.value}/${encodeURIComponent(key)}`, + )) as unknown as ApiResponse if (!response.success) throw new Error(response.message) } @@ -217,6 +218,11 @@ function isRecognized(item: RecognitionCacheItem): boolean { return Boolean(recognitionId && recognitionId !== '0') } +/** 获取移动端识别缓存卡片的稳定渲染 key。 */ +function getRecognitionCacheItemKey(item: RecognitionCacheItem): string { + return item.key +} + /** 获取本地化的媒体类型名称。 */ function getMediaTypeLabel(mediaType: string): string { if (mediaType === 'movie') return t('setting.cache.mediaType.movie') @@ -359,14 +365,17 @@ watch(recognitionSource, () => {