Skip to content

Commit

Permalink
Fixed downloading and scanning for volumes starting with a number (#41)
Browse files Browse the repository at this point in the history
* added test case for comics beginning with numbers

* made small change to series regex to allow this to pass.
also updated testcase.

* Update comic series details in test cases

The details of the 'Infinity Gauntlet' and '100 Bullets' comic series in the tests for the backend file handling were updated. This includes changing the issue range for both series. Changes were made to keep the tests in sync with the updated data specifications and enhance the test coverage.

---------

Co-authored-by: Casvt <[email protected]>
  • Loading branch information
ajurna and Casvt authored Jul 13, 2023
1 parent d35d8c2 commit 34eecf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
issue_regex_6 = compile(r'(?<!\()\b(' + issue_regex_snippet + r')\b(?!\))', IGNORECASE)
issue_regex_7 = compile(r'^(-?' + issue_regex_snippet + r')$', IGNORECASE)
year_regex = compile(r'\(' + year_regex_snippet + r'\)|--' + year_regex_snippet + r'--|, ' + year_regex_snippet + r'\s{3}|\b(?:(?:\d{2}-){1,2}(\d{4})|(\d{4})(?:-\d{2}){1,2})\b', IGNORECASE)
series_regex = compile(r'(^(\d+\.?)?\s+|\s(?=\s)|[\s,]+$)')
series_regex = compile(r'(^(\d+\.)?\s+|\s(?=\s)|[\s,]+$)')
annual_regex = compile(r'\+[\s\.]?annuals?|annuals?[\s\.]?\+|^((?!annuals?).)*$', IGNORECASE)

def _calc_float_issue_number(issue_number: str) -> Union[float, None]:
Expand Down
8 changes: 7 additions & 1 deletion tests/Tbackend/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ def test_general(self):
'Infinity Gauntlet #1 – 6 (1991-1992)':
{'series': 'Infinity Gauntlet', 'year': 1991, 'volume_number': 1, 'special_version': None, 'issue_number': (1.0, 6.0), 'annual': False},

'Batman 026-050 (1945-1949) GetComics.INFO/Batman 048 52p ctc (08-1948) flattermann.cbr':
'1. Infinity Gauntlet #2 - 100 (1999-2009)':
{'series': 'Infinity Gauntlet', 'year': 1999, 'volume_number': 1, 'special_version': None, 'issue_number': (2.0, 100.0), 'annual': False},

'100 Bullets #1 - 101 (1999-2009)':
{'series': '100 Bullets', 'year': 1999, 'volume_number': 1, 'special_version': None, 'issue_number': (1.0, 101.0), 'annual': False},

'Batman 026-050 (1945-1949) GetComics.INFO/Batman 048 52p ctc (08-1948) flattermann.cbr':
{'series': 'Batman', 'year': 1945, 'volume_number': 1, 'special_version': None, 'issue_number': 48.0, 'annual': False}
}
self.run_cases(cases)
Expand Down

0 comments on commit 34eecf3

Please sign in to comment.