mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 19:36:36 +08:00
fix review regressions in titles and strm paths
This commit is contained in:
@@ -145,7 +145,7 @@ function stripLibraryCategoryAfterSTRMRoot(raw: string) {
|
||||
if (strmIndex < 0 || strmIndex >= parts.length - 1) return ''
|
||||
const tail = parts.slice(strmIndex + 1).filter((part) => part.trim())
|
||||
const categoryParts = categoryPartsFromPath(tail)
|
||||
if (!categoryParts?.length) return ''
|
||||
if (!categoryParts || categoryParts.length < 2) return ''
|
||||
return trimPath(parts.slice(0, strmIndex + 1).join('/'))
|
||||
}
|
||||
|
||||
|
||||
@@ -197,9 +197,12 @@ const EPISODE_ONLY_TITLE_RE =
|
||||
const EPISODE_TITLE_RE =
|
||||
/^第\s*[0-9一二三四五六七八九十百零两]+\s*[集期话話](?:\s*[上下])?\s*[::].+/
|
||||
|
||||
const EPISODIC_RELEASE_TITLE_RE =
|
||||
/(?:^|\s)(?:s\d{1,2}\s*e\d{1,3}|season\s*\d{1,2}\s*(?:episode|ep)\s*\d{1,3}|\d{1,2}x\d{1,3}|e(?:p(?:isode)?)?\s*\d{1,3})(?:\s|$)/i
|
||||
|
||||
function unsafeEpisodeTitle(title: string): boolean {
|
||||
const value = title.trim()
|
||||
return EPISODE_ONLY_TITLE_RE.test(value) || EPISODE_TITLE_RE.test(value)
|
||||
return EPISODE_ONLY_TITLE_RE.test(value) || EPISODE_TITLE_RE.test(value) || EPISODIC_RELEASE_TITLE_RE.test(normalizeTitle(value))
|
||||
}
|
||||
|
||||
export function seriesTitleFromPath(path?: string): string {
|
||||
|
||||
Reference in New Issue
Block a user