Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot download files for comics beginning with a number #41

Merged
merged 4 commits into from
Jul 13, 2023

Conversation

ajurna
Copy link
Contributor

@ajurna ajurna commented May 31, 2023

this is a fix for issue #40 .
added a test and made a small change to regex.
not 100% on the regex purpose so would appreciate if this brakes something a test case for it?

@Casvt
Copy link
Owner

Casvt commented Jul 11, 2023

Alright I checked it out and this is what I found:

Function of the regex

The use of the series_regex is not to get the series from the filename, but to clean the extracted series. Sometimes, files have an N. at the start of the filename, to show order, like the following:

1. Infinity Gauntlet #1.cbr
2. Silver Surfer #54.cbr
3. Infinity Gauntlet #2.cbr

The regex removes the prefix, so that the series isn't 1. Infinity Gauntlet, but Infinity Gauntlet.

What caused the problem

The . is not required, so 1 Infinity Gauntlet would also result in Infinity Gauntlet. But because of that, 100 Bullets ends up becoming Bullets. By making the . required (like you did in your commit), we fix the problem.

The test cases

  1. Make the dict in the test case not sorted by keys, but instead in the order that the other tests have. Doesn't impact functionality but makes the file more uniform.
  2. Change the #1 - 100 to something like #1 - 99, because 100 is already used in the string and we want no confusion over which 100 was picked by the algorithm. Not a single test case in the file uses the same number multiple times to refer to different things.
  3. Add a second test case for when the regex should remove the number:
			'1. Infinity Gauntlet #2 - 100 (1999-2009)':
				{'series': 'Infinity Gauntlet', 'year': 1999, 'volume_number': 1, 'special_version': None, 'issue_number': (2.0, 101.0), 'annual': False}

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.
@ajurna
Copy link
Contributor Author

ajurna commented Jul 13, 2023

those changes are added.

@Casvt Casvt merged commit 34eecf3 into Casvt:development Jul 13, 2023
@ajurna ajurna deleted the number_comcis branch July 14, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants