From 7efc32637b40c4b2869a245843248032b0997d30 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 13 Jul 2026 09:48:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=A4=9A=E7=B1=BB?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/types.ts | 30 + .../cache/TmdbRecognitionCachePanel.vue | 660 ++++++++++++++++++ src/components/dialog/ShortcutToolDialog.vue | 9 +- src/locales/en-US.ts | 19 +- src/locales/zh-CN.ts | 19 +- src/locales/zh-TW.ts | 19 +- src/views/system/CacheView.vue | 329 ++++++--- 7 files changed, 989 insertions(+), 96 deletions(-) create mode 100644 src/components/cache/TmdbRecognitionCachePanel.vue diff --git a/src/api/types.ts b/src/api/types.ts index 4f973f77..cbc30761 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1723,6 +1723,36 @@ export interface TorrentCacheData { data: TorrentCacheItem[] } +// TheMovieDb 识别缓存项 +export interface TmdbRecognitionCacheItem { + // 缓存键 + key: string + // TMDB ID,0 表示未识别 + tmdb_id: number + // 识别后的标题 + title: string + // 识别后的年份 + year: string + // 媒体类型 + media_type: string + // TMDB 海报相对路径 + poster_path?: string + // TMDB 背景图相对路径 + backdrop_path?: string +} + +// TheMovieDb 识别缓存数据 +export interface TmdbRecognitionCacheData { + // 缓存总数 + count: number + // 已识别数量 + recognized: number + // 未识别数量 + unrecognized: number + // 缓存数据 + data: TmdbRecognitionCacheItem[] +} + // 订阅分享统计 export interface SubscribeShareStatistics { // 分享人 diff --git a/src/components/cache/TmdbRecognitionCachePanel.vue b/src/components/cache/TmdbRecognitionCachePanel.vue new file mode 100644 index 00000000..9e4b7740 --- /dev/null +++ b/src/components/cache/TmdbRecognitionCachePanel.vue @@ -0,0 +1,660 @@ + + + + + diff --git a/src/components/dialog/ShortcutToolDialog.vue b/src/components/dialog/ShortcutToolDialog.vue index 1d8af7fb..9957f126 100644 --- a/src/components/dialog/ShortcutToolDialog.vue +++ b/src/components/dialog/ShortcutToolDialog.vue @@ -129,13 +129,8 @@ const bodyClasses = computed(() => [ display: flex; overflow: hidden; flex-direction: column; - background: rgb(var(--v-theme-surface)); - } - - html[data-theme='transparent'] .cache-shortcut-dialog-card, - .v-theme--transparent .cache-shortcut-dialog-card { - backdrop-filter: blur(var(--transparent-blur, 10px)); - background: rgba(var(--v-theme-surface), var(--transparent-opacity-heavy, 0.5)); + backdrop-filter: var(--app-grouped-list-backdrop-filter); + background: var(--app-grouped-list-background); } .cache-shortcut-dialog-body { diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 6f4c3932..b2dc5597 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -2386,14 +2386,24 @@ export default { }, cache: { title: 'Cache Management', - subtitle: 'Manage cached site resources', + subtitle: 'Manage system caches', + cacheType: 'Cache Type', + torrentCache: 'Resource Cache', + tmdbRecognitionCache: 'Recognition Cache', totalCount: 'Total Count', siteCount: 'Site Count', + recognized: 'Recognized', + recognizedOnly: 'Recognized Only', + unrecognizedOnly: 'Unrecognized Only', + allStatuses: 'All Statuses', filterByTitle: 'Filter by Title', filterBySite: 'Filter by Site', + filterRecognitionCache: 'Search cache key, title, or TMDB ID', selectSite: 'Select Site', loadingMore: 'Loading...', refresh: 'Refresh Cache', + refreshList: 'Refresh List', + listRefreshSuccess: 'Cache list refreshed', deleteSelected: 'Delete Selected', clearAll: 'Clear All Cache', refreshSuccess: 'Cache refresh completed', @@ -2410,15 +2420,20 @@ export default { reidentifySuccess: 'Re-identification completed', reidentifyFailed: 'Re-identification failed', poster: 'Poster', + cacheKey: 'Recognition Request', + tmdbId: 'TMDB ID', torrentTitle: 'Title', site: 'Site', size: 'Size', publishTime: 'Publish Time', recognitionResult: 'Recognition Result', + recognitionStatus: 'Status', actions: 'Actions', unrecognized: 'Unrecognized', noData: 'No cache data', noDataHint: 'Click "Refresh Cache" button to get the latest torrent cache', + noRecognitionCache: 'No TheMovieDb recognition cache', + noRecognitionCacheHint: 'Recognition records will appear here after media is identified', reidentifyDialog: { title: 'Re-identify', torrentInfo: 'Torrent Info', @@ -2433,8 +2448,10 @@ export default { mediaType: { movie: 'Movie', tv: 'TV Show', + unknown: 'Unknown', }, clearConfirm: 'Are you sure you want to clear all cache?', + tmdbClearConfirm: 'Clear all TheMovieDb recognition cache?', }, }, dialog: { diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index d3f4f084..43dabe84 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -2341,14 +2341,24 @@ export default { }, cache: { title: '缓存管理', - subtitle: '管理缓存的站点资源', + subtitle: '管理多类系统缓存', + cacheType: '缓存类型', + torrentCache: '资源缓存', + tmdbRecognitionCache: '识别缓存', totalCount: '总条数', siteCount: '站点数', + recognized: '已识别', + recognizedOnly: '仅已识别', + unrecognizedOnly: '仅未识别', + allStatuses: '全部状态', filterByTitle: '按标题筛选', filterBySite: '按站点筛选', + filterRecognitionCache: '搜索缓存键、标题或 TMDB ID', selectSite: '选择站点', loadingMore: '加载中...', refresh: '刷新缓存', + refreshList: '刷新列表', + listRefreshSuccess: '缓存列表已刷新', deleteSelected: '删除选中', clearAll: '清空缓存', refreshSuccess: '缓存刷新完成', @@ -2365,15 +2375,20 @@ export default { reidentifySuccess: '重新识别完成', reidentifyFailed: '重新识别失败', poster: '海报', + cacheKey: '识别请求', + tmdbId: 'TMDB ID', torrentTitle: '标题', site: '站点', size: '大小', publishTime: '发布时间', recognitionResult: '识别结果', + recognitionStatus: '识别状态', actions: '操作', unrecognized: '未识别', noData: '暂无缓存数据', noDataHint: '点击"刷新缓存"按钮获取最新的种子缓存', + noRecognitionCache: '暂无 TheMovieDb 识别缓存', + noRecognitionCacheHint: '完成媒体识别后,缓存记录会显示在这里', reidentifyDialog: { title: '重新识别', torrentInfo: '种子信息', @@ -2388,8 +2403,10 @@ export default { mediaType: { movie: '电影', tv: '电视剧', + unknown: '未知', }, clearConfirm: '确认清空所有缓存吗?', + tmdbClearConfirm: '确认清空全部 TheMovieDb 识别缓存吗?', }, }, dialog: { diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 19e98a52..6570475a 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -2340,14 +2340,24 @@ export default { }, cache: { title: '緩存管理', - subtitle: '管理緩存的站點資源', + subtitle: '管理多類系統緩存', + cacheType: '緩存類型', + torrentCache: '資源緩存', + tmdbRecognitionCache: '識別緩存', totalCount: '總條數', siteCount: '站點數', + recognized: '已識別', + recognizedOnly: '僅已識別', + unrecognizedOnly: '僅未識別', + allStatuses: '全部狀態', filterByTitle: '按標題篩選', filterBySite: '按站點篩選', + filterRecognitionCache: '搜索緩存鍵、標題或 TMDB ID', selectSite: '選擇站點', loadingMore: '加載中...', refresh: '刷新緩存', + refreshList: '刷新列表', + listRefreshSuccess: '緩存列表已刷新', deleteSelected: '刪除選中', clearAll: '清空緩存', refreshSuccess: '緩存刷新完成', @@ -2364,15 +2374,20 @@ export default { reidentifySuccess: '重新識別完成', reidentifyFailed: '重新識別失敗', poster: '海報', + cacheKey: '識別請求', + tmdbId: 'TMDB ID', torrentTitle: '標題', site: '站點', size: '大小', publishTime: '發布時間', recognitionResult: '識別結果', + recognitionStatus: '識別狀態', actions: '操作', unrecognized: '未識別', noData: '暫無緩存數據', noDataHint: '點擊"刷新緩存"按鈕獲取最新的種子緩存', + noRecognitionCache: '暫無 TheMovieDb 識別緩存', + noRecognitionCacheHint: '完成媒體識別後,緩存記錄會顯示在這裡', reidentifyDialog: { title: '重新識別', torrentInfo: '種子信息', @@ -2387,8 +2402,10 @@ export default { mediaType: { movie: '電影', tv: '電視劇', + unknown: '未知', }, clearConfirm: '確認清空所有緩存嗎?', + tmdbClearConfirm: '確認清空全部 TheMovieDb 識別緩存嗎?', }, }, dialog: { diff --git a/src/views/system/CacheView.vue b/src/views/system/CacheView.vue index 3212d212..00937433 100644 --- a/src/views/system/CacheView.vue +++ b/src/views/system/CacheView.vue @@ -9,13 +9,17 @@ import { useGlobalSettingsStore } from '@/stores' import { usePWA } from '@/composables/usePWA' import { openSharedDialog } from '@/composables/useSharedDialog' import { useDisplay } from 'vuetify' +import TmdbRecognitionCachePanel from '@/components/cache/TmdbRecognitionCachePanel.vue' const CacheReidentifyDialog = defineAsyncComponent(() => import('@/components/dialog/CacheReidentifyDialog.vue')) type InfiniteScrollStatus = 'ok' | 'empty' | 'loading' | 'error' +type CacheManagerType = 'torrent' | 'tmdb' const MOBILE_CACHE_PAGE_SIZE = 20 +const activeCacheType = ref('torrent') + // 国际化 const { t } = useI18n() @@ -336,7 +340,32 @@ watch([titleFilter, siteFilter], () => { + +