diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 5f0b489..dd5c4c6 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -30,7 +30,6 @@ import rarfile import requests NUMBER_REGEX = re.compile('[0-90-9]+') -ALPHABETIC_NUMBERING_REGEX = re.compile('^(?P[^a-za-z0-90-9]*)((?P[a-za-z])(?P[^a-za-z0-90-9]*))?$', re.I) DLSITE_ID_REGEX = re.compile('^[BR]J[0-9]+$') FANZA_ID_REGEX = re.compile('^d_[0-9]+$') @@ -65,13 +64,11 @@ FRONT_COVER_REGEX = re.compile('(? 1: + debug('Ending is more than one character, giving up') return None - - current_prefix_suffix = (ending_match.group('prefix'), ending_match.group('suffix') or '') - if prefix_suffix is None: - prefix_suffix = current_prefix_suffix - elif current_prefix_suffix != prefix_suffix: - debug(f'Ending prefix/suffix does not match {prefix_suffix}, giving up') - return None - - ending_letter = (ending_match.group('letter') or '').lower() - if ending_letter == '': - index = 0 - elif ending_letter >= 'a' and ending_letter <= 'z': - index = ord(ending_letter) - ord('a') + 1 - elif ending_letter >= 'a' and ending_letter <= 'z': - index = ord(ending_letter) - ord('a') + 1 - else: + index = 0 if ending == '' else ord(ending.lower()) - ord('a') + 1 + if index < 0 or index > 26: debug('Ending is not a letter, giving up') return None - if (index,) in alphabetized: debug(f'Index value {index} is already present, giving up') return None alphabetized[(index,)] = [entry] - return alphabetized def check_extension(path, exts):