From 49b2a0c81f0d9bac8ed2ac2e8c9fc251cc5eceb4 Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Tue, 23 Sep 2025 16:14:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E7=A7=BB=E9=99=A4=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E4=BF=A1=E6=81=AF=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BB=85=E5=A4=84=E7=90=86=E5=B8=B8=E8=A7=81?= =?UTF-8?q?=E5=80=BC=E7=99=BD=E5=90=8D=E5=8D=95=EF=BC=8C=E9=99=8D=E4=BD=8E?= =?UTF-8?q?=E8=AF=AF=E5=88=A4=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/sort_file_by_name.js | 153 ++++++++++++++--------------- quark_auto_save.py | 144 +++++++++++++-------------- 2 files changed, 142 insertions(+), 155 deletions(-) diff --git a/app/static/js/sort_file_by_name.js b/app/static/js/sort_file_by_name.js index 68c00e0..f91ad94 100644 --- a/app/static/js/sort_file_by_name.js +++ b/app/static/js/sort_file_by_name.js @@ -28,6 +28,59 @@ function sortFileByName(file) { let filename = typeof file === 'object' ? (file.file_name || '') : file; let update_time = typeof file === 'object' ? (file.updated_at || 0) : 0; let file_name_without_ext = filename.replace(/\.[^/.]+$/, ''); + + // 0. 预处理(前移):移除技术规格与季号,供后续“日期与集数”提取共同使用 + // 这样可以避免 30FPS/1080p/Season 等噪音影响识别 + let cleanedName = file_name_without_ext; + try { + const techSpecs = [ + // 分辨率相关(限定常见p档) + /\b(?:240|360|480|540|720|900|960|1080|1440|2160|4320)[pP]\b/g, + // 常见分辨率 WxH(白名单) + /\b(?:640x360|640x480|720x480|720x576|854x480|960x540|1024x576|1280x720|1280x800|1280x960|1366x768|1440x900|1600x900|1920x1080|2560x1080|2560x1440|3440x1440|3840x1600|3840x2160|4096x2160|7680x4320)\b/g, + /(? 12) [month, day] = [day, month]; @@ -87,7 +140,7 @@ function sortFileByName(file) { } // MM-DD if (date_value === Infinity) { - match = filename.match(/(?