emby剧集弹幕匹配优化

This commit is contained in:
mtvpls
2026-01-06 15:56:57 +08:00
parent 3e39004929
commit 2b22158f4b

View File

@@ -2930,6 +2930,14 @@ function PlayPageClient() {
const extractEpisodeNumber = (title: string): number | null => { const extractEpisodeNumber = (title: string): number | null => {
if (!title) return null; if (!title) return null;
// 优先匹配 Emby 格式S01E01, S02E09 等
const embyMatch = title.match(/[Ss]\d+[Ee](\d+)/);
if (embyMatch) {
return parseInt(embyMatch[1], 10);
}
// 降级到原本的策略:纯数字或"第X集/话"格式
const match = title.match(/^(\d+)$|第?\s*(\d+)\s*[集话話]?/); const match = title.match(/^(\d+)$|第?\s*(\d+)\s*[集话話]?/);
return match ? parseInt(match[1] || match[2], 10) : null; return match ? parseInt(match[1] || match[2], 10) : null;
}; };