Improved handling of years
This commit is contained in:
parent
6ade55f0d6
commit
0ac862ecfb
1 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ class DcSearchResult:
|
|||
"""Description, listing available publications to label, as returned by search."""
|
||||
|
||||
def __repr__(self):
|
||||
return f"{self.label}\n{self.tagline}\n{self.year} | {' | '.join(self.formats)}\n{' | '.join(self.titles)}\n[{self.fid} | {self.url}]\n{self.description}\n"
|
||||
return f"{self.label}\n{self.tagline}\n{self.year} | {self.years} | {' | '.join(self.formats)}\n{' | '.join(self.titles)}\n[{self.fid} | {self.url}]\n{self.description}\n"
|
||||
|
||||
|
||||
class DvdCompare:
|
||||
|
@ -63,7 +63,7 @@ class DvdCompare:
|
|||
result.label.replace("", "-").replace("\x96", "-").split(" AKA ")
|
||||
): # Iterate over alternative titles and collect information
|
||||
part_matches = re.match(
|
||||
r"^(?P<title>[^()\n]*[^()\s])(?:\s\((?P<prefix>The|A|An)\)(?P<suffix>[^()\n]+)?)?(?P<formats> ?(?:\([^()]*[a-z]+[^()]*\)\s?)+)?(?P<years>(?: ?\((?P<range>(?P<year>[0-9]{4})(?:[-,/][0-9]{1,2}(?:[0-9]{2})?)?)\)))?",
|
||||
r"^(?P<title>[^()\n]*[^()\s])(?:\s\((?P<prefix>The|A|An)\)(?P<suffix>[^()\n]+)?)?(?P<formats> ?(?:\([^()]*[a-z]+[^()]*\)\s?)+)?(?: ?\((?P<years>(?P<year>[0-9]{4})(?:[-,/][0-9]{1,2}(?:[0-9]{2})?)?)\))?",
|
||||
part,
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue