Skip to content

Commit

Permalink
Fixed covers being seen as TPB's (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Casvt committed Jul 23, 2023
1 parent 4c881e6 commit 0999b0a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backend/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
japanese_volume_regex = compile(r'(\d+)巻', IGNORECASE)

# Extract data from (stripped)filename
special_version_regex = compile(r'(?:\b|\()(tpb|os|one\-shot|ogn|gn)(?:\b|\))', IGNORECASE)
special_version_regex = compile(r'(?:\b|\()(tpb|os|one\-shot|ogn|gn|cover)(?:\b|\))', IGNORECASE)
volume_regex = compile(volume_regex_snippet, IGNORECASE)
volume_folder_regex = compile(volume_regex_snippet + r'|^(\d+)$', IGNORECASE)
issue_regex = compile(r'\( (-?' + issue_regex_snippet + r')\)', IGNORECASE)
Expand Down Expand Up @@ -361,9 +361,12 @@ def scan_files(volume_data: dict) -> None:
file_data = extract_filename_data(file)

# Check if file matches volume
if (file_data['volume_number'] is not None
and file_data['volume_number'] != volume_data['volume_number']
and file_data['volume_number'] != volume_data['year']):
if ((
file_data['volume_number'] is not None
and file_data['volume_number'] != volume_data['volume_number']
and file_data['volume_number'] != volume_data['year']
)
or file_data['special_version'] == 'cover'):
continue

# If file is special version, it means it covers all issues in volume so add it to every issue
Expand Down

0 comments on commit 0999b0a

Please sign in to comment.