runOn: a space after the extension, not a bare dash
0c5ede9 cut "Angry.Birds.Rio.v1.2.2.cracked.READ.NFO-THETA.rar" at .NFO: the
release lost its group, and two groups' releases of one game would merge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0c5ede99dd
commit
6f7a1692d6
3 files changed
+7
-3
No files matched your search
@@ -298,7 +298,8 @@ const RUN_ON = /\.(?:part\d+\.rar|vol\d+[+-]\d+\.par2|par2|rar|r\d{2,3}|7z(?:\.\
|
||||
/**
|
||||
* A quoted name that runs on past its extension into a title ("lois 1258 Billy Joel - Extremes.part01.rar lois 1258 Billy
|
||||
* Joel - Extremes ", "GrooveCoverage.part26.rarGrooveCoveragebestof", "Goga Sekulic.part134.rar - Goga Sekulic - …": each
|
||||
* part a release of its own): the name up to that extension, when a space or a dash follows it, or the name's own start.
|
||||
* part a release of its own): the name up to that extension, when a space follows it, or the name's own start. Not a
|
||||
* bare dash ("Angry.Birds.Rio.v1.2.2.cracked.READ.NFO-THETA.rar" keeps its group).
|
||||
*/
|
||||
export function runOn(name: string): string {
|
||||
const head = name.slice(0, 4).toLowerCase()
|
||||
@@ -307,7 +308,7 @@ export function runOn(name: string): string {
|
||||
const end = m.index + m[0].length
|
||||
const rest = name.slice(end)
|
||||
if (rest.length === 0) return name
|
||||
if (/^\s|^\s*-/.test(rest) || (ascii && rest.slice(0, 4).toLowerCase() === head)) return name.slice(0, end)
|
||||
if (/^\s/.test(rest) || (ascii && rest.slice(0, 4).toLowerCase() === head)) return name.slice(0, end)
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user