Fix parsing '&' with the "complicated" filename parser

This commit is contained in:
Timmy Welch 2023-10-12 01:26:31 -07:00
parent abfd97d915
commit 114a0bb615
2 changed files with 20 additions and 2 deletions

View File

@ -1237,8 +1237,11 @@ def join_title(lst: list[filenamelexer.Item]) -> str:
if lst[i + 1].typ in [filenamelexer.ItemType.Operator, filenamelexer.ItemType.Symbol]:
# exept if followed by a dollarsign
if not (
lst[i].typ in [filenamelexer.ItemType.Number, filenamelexer.ItemType.IssueNumber]
and lst[i + 1].val == "$"
(
lst[i].typ in [filenamelexer.ItemType.Number, filenamelexer.ItemType.IssueNumber]
and lst[i + 1].val == "$"
)
or lst[i + 1].val == "&"
):
continue

View File

@ -23,6 +23,21 @@ datadir = pathlib.Path(__file__).parent / "data"
cbz_path = datadir / "Cory Doctorow's Futuristic Tales of the Here and Now #001 - Anda's Game (2007).cbz"
names = [
(
"Drystan & Esyllt #3",
"Shortened word followed by a number eg No. 13, Mr. 13",
{
"issue": "3",
"series": "Drystan & Esyllt",
"title": "",
"volume": "",
"year": "",
"remainder": "",
"issue_count": "",
"alternate": "",
},
(False, False),
),
(
"Michel Vaillant #5 Nr. 13 aan de start",
"Shortened word followed by a number eg No. 13, Mr. 13",