mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
fix(cache): 小屏识别缓存改为单列表切换避免影视音乐重叠
This commit is contained in:
+18
-5
@@ -65,11 +65,17 @@ const statusOptions = computed(() => [
|
|||||||
{ title: t('setting.cache.unrecognizedOnly'), value: 'unrecognized' },
|
{ title: t('setting.cache.unrecognizedOnly'), value: 'unrecognized' },
|
||||||
])
|
])
|
||||||
|
|
||||||
const typeOptions = computed(() => [
|
const typeOptions = computed(() => {
|
||||||
{ title: t('setting.cache.recognitionTypeOptions.all'), value: 'all' },
|
const options = [
|
||||||
{ title: t('setting.cache.recognitionTypeOptions.media'), value: 'media' },
|
{ title: t('setting.cache.recognitionTypeOptions.media'), value: 'media' },
|
||||||
{ title: t('setting.cache.recognitionTypeOptions.music'), value: 'music' },
|
{ title: t('setting.cache.recognitionTypeOptions.music'), value: 'music' },
|
||||||
])
|
]
|
||||||
|
// 小屏幕下不提供"全部"选项,避免两个列表同时渲染导致重叠
|
||||||
|
if (!isMobile.value) {
|
||||||
|
options.unshift({ title: t('setting.cache.recognitionTypeOptions.all'), value: 'all' })
|
||||||
|
}
|
||||||
|
return options
|
||||||
|
})
|
||||||
|
|
||||||
// 影视与音乐缓存统计汇总展示
|
// 影视与音乐缓存统计汇总展示
|
||||||
const totalCount = computed(() => cacheData.value.count + musicCacheData.value.count)
|
const totalCount = computed(() => cacheData.value.count + musicCacheData.value.count)
|
||||||
@@ -334,6 +340,13 @@ onMounted(() => {
|
|||||||
void loadCacheData()
|
void loadCacheData()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 小屏幕下切换到"全部"时回退为影视,避免两个列表同时渲染
|
||||||
|
watch(isMobile, mobile => {
|
||||||
|
if (mobile && typeFilter.value === 'all') {
|
||||||
|
typeFilter.value = 'media'
|
||||||
|
}
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
watch([searchFilter, statusFilter, typeFilter], () => {
|
watch([searchFilter, statusFilter, typeFilter], () => {
|
||||||
resetMobilePagination()
|
resetMobilePagination()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user