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(/(?