修复bug,第一次导出缩略图,后面有了高清图后再次导出应该覆盖

按原图、中图和缩略图对本地图片资源分级,始终优先选择高清变体。

增量导出仅复用满足清晰度要求的图片,重新探测旧缩略图并在高清图出现后替换;仅缩略图降级时显示提示。
This commit is contained in:
Nanin committed 2026-08-08 20:53:40 +08:00
1 parent 7904d42442
commit 0e96c146d5
9 files changed
+185 -32

No files matched your search

+3 -6
View File
@@ -3,20 +3,17 @@ import type { ExportRequest } from './export'
export type ImageExportAttempt = {
allowThumbnail: boolean
preferThumbnail: boolean
fallback: boolean
}
export function getImageExportAttempts(
request: Pick<ExportRequest, 'preferOriginal' | 'fallbackThumbnail'>
): ImageExportAttempt[] {
if (request.preferOriginal === false) {
return [{ allowThumbnail: true, preferThumbnail: true, fallback: false }]
return [{ allowThumbnail: true, preferThumbnail: true }]
}
const attempts: ImageExportAttempt[] = [
{ allowThumbnail: false, preferThumbnail: false, fallback: false }
]
const attempts: ImageExportAttempt[] = [{ allowThumbnail: false, preferThumbnail: false }]
if (request.fallbackThumbnail !== false) {
attempts.push({ allowThumbnail: true, preferThumbnail: true, fallback: true })
attempts.push({ allowThumbnail: true, preferThumbnail: true })
}
return attempts
}