copy volume into issue if issue not available

This commit is contained in:
AJ Slater 2024-02-20 13:42:37 -08:00
parent 3304ba76d6
commit 93ac5760a0
3 changed files with 21 additions and 8 deletions

View File

@ -6,6 +6,8 @@
either issue, year or volume. either issue, year or volume.
- Issue numbers that lead with a '#' character may start with alphabetical - Issue numbers that lead with a '#' character may start with alphabetical
characters. characters.
- If volume is parsed, but issue number is not, the issue number is copied from
the volume number.
- ComicFilenameParser and ComicFilenameSerializer classes are available as well - ComicFilenameParser and ComicFilenameSerializer classes are available as well
as the old function API. as the old function API.

View File

@ -213,6 +213,10 @@ class ComicFilenameParser:
self._parse_item(ISSUE_ANYWHERE_RE) self._parse_item(ISSUE_ANYWHERE_RE)
self._log_progress("AFTER ISSUE PICKUP") self._log_progress("AFTER ISSUE PICKUP")
# Copy volume into issue if it's all we have.
if "issue" not in self.metadata and "volume" in self.metadata:
self.metadata["issue"] = self.metadata["volume"]
self._add_remainders() self._add_remainders()
return self.metadata return self.metadata

View File

@ -22,6 +22,7 @@ TEST_COMIC_FIELDS_VOL = {
TEST_COMIC_VOL_ONLY = { TEST_COMIC_VOL_ONLY = {
"series": "Long Series Name", "series": "Long Series Name",
"volume": "1", "volume": "1",
"issue": "1",
"title": "Title", "title": "Title",
"original_format": "TPB", "original_format": "TPB",
"year": "2000", "year": "2000",
@ -74,6 +75,7 @@ FNS = {
"Arkenstone Vol. 01 - The Smell of Burnt Toast (2020) (digital) (My-brother).cbr": { "Arkenstone Vol. 01 - The Smell of Burnt Toast (2020) (digital) (My-brother).cbr": {
"series": "Arkenstone", "series": "Arkenstone",
"volume": "01", "volume": "01",
"issue": "01",
"year": "2020", "year": "2020",
"ext": "cbr", "ext": "cbr",
"scan_info": "My-brother", "scan_info": "My-brother",
@ -83,6 +85,7 @@ FNS = {
"The_Arkenstone_v03_(2002)_(Digital)_(DR_&_Quenya-Elves).cbr": { "The_Arkenstone_v03_(2002)_(Digital)_(DR_&_Quenya-Elves).cbr": {
"series": "The Arkenstone", "series": "The Arkenstone",
"volume": "03", "volume": "03",
"issue": "03",
"year": "2002", "year": "2002",
"ext": "cbr", "ext": "cbr",
"scan_info": "DR & Quenya-Elves", "scan_info": "DR & Quenya-Elves",
@ -101,6 +104,7 @@ FNS = {
"Kartalk Library Edition v01 (1992) (digital) (Son of Ultron-Empire).cbr": { "Kartalk Library Edition v01 (1992) (digital) (Son of Ultron-Empire).cbr": {
"series": "Kartalk Library Edition", "series": "Kartalk Library Edition",
"volume": "01", "volume": "01",
"issue": "01",
"year": "1992", "year": "1992",
"ext": "cbr", "ext": "cbr",
"original_format": "digital", "original_format": "digital",
@ -109,6 +113,7 @@ FNS = {
"Kind of Deadly v02 - Last Bullet (2006) (Digital) (Zone-Empire).cbr": { "Kind of Deadly v02 - Last Bullet (2006) (Digital) (Zone-Empire).cbr": {
"series": "Kind of Deadly", "series": "Kind of Deadly",
"volume": "02", "volume": "02",
"issue": "02",
"year": "2006", "year": "2006",
"ext": "cbr", "ext": "cbr",
"original_format": "Digital", "original_format": "Digital",
@ -142,6 +147,7 @@ FNS = {
"Jeremy John v01 - Uninterested! (2007) (Digital) (Asgard-Empire).cbr": { "Jeremy John v01 - Uninterested! (2007) (Digital) (Asgard-Empire).cbr": {
"series": "Jeremy John", "series": "Jeremy John",
"volume": "01", "volume": "01",
"issue": "01",
"year": "2007", "year": "2007",
"ext": "cbr", "ext": "cbr",
"original_format": "Digital", "original_format": "Digital",
@ -168,6 +174,7 @@ FNS = {
"Darkwad by Carlos Zemo v01 - Knuckle Fight (2009) (Digital) (Zone-Empire).cbr": { "Darkwad by Carlos Zemo v01 - Knuckle Fight (2009) (Digital) (Zone-Empire).cbr": {
"series": "Darkwad by Carlos Zemo", "series": "Darkwad by Carlos Zemo",
"volume": "01", "volume": "01",
"issue": "01",
"year": "2009", "year": "2009",
"ext": "cbr", "ext": "cbr",
"title": "Knuckle Fight", "title": "Knuckle Fight",
@ -314,6 +321,14 @@ FNS.update(
"series": "Free Comic Book Day - Avengers Hulk", "series": "Free Comic Book Day - Avengers Hulk",
"year": "2021", "year": "2021",
}, },
# CT assumes the volume is also the issue number if it can't find an issue number
"Avengers By Brian Michael Bendis volume 03 (2013).cbz": {
"ext": "cbz",
"issue": "03",
"series": "Avengers By Brian Michael Bendis",
"volume": "03",
"year": "2013",
},
} }
) )
LATER = { LATER = {
@ -338,14 +353,6 @@ LATER = {
# Not examined yet. # Not examined yet.
FNS.update( FNS.update(
{ {
# CT assumes the volume is also the issue number if it can't find an issue number
"Avengers By Brian Michael Bendis volume 03 (2013).cbz": {
"ext": "cbz",
"issue": "3",
"series": "Avengers By Brian Michael Bendis",
"volume": "03",
"year": "2013",
},
# CT has extra processing to re-attach the year in this case # CT has extra processing to re-attach the year in this case
"Blade Runner Free Comic Book Day 2021 (2021).cbr": { "Blade Runner Free Comic Book Day 2021 (2021).cbr": {
"ext": "cbr", "ext": "cbr",