Skip to content

Commit

Permalink
Quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Jul 1, 2024
1 parent 4bb3d03 commit 0ed057a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,31 +277,31 @@ def __init__(
if self.case_sensitive_matches:
self.folder_exclusion_regex_re = (
re.compile("|".join(self.folder_exclusion_regex), re.DOTALL)
if self.folder_exclusion_regex_re
if self.folder_exclusion_regex
else None
)
self.file_name_exclusion_regex_re = (
re.compile("|".join(self.file_name_exclusion_regex), re.DOTALL)
if self.file_name_exclusion_regex_re
if self.file_name_exclusion_regex
else None
)
self.file_extension_allowlist = (
self.file_extension_allowlist_re = (
re.compile("|".join(self.file_extension_allowlist), re.DOTALL)
if self.file_extension_allowlist
else None
)
else:
self.folder_exclusion_regex_re = (
re.compile("|".join(self.folder_exclusion_regex), re.IGNORECASE | re.DOTALL)
if self.folder_exclusion_regex_re
if self.folder_exclusion_regex
else None
)
self.file_name_exclusion_regex_re = (
re.compile("|".join(self.file_name_exclusion_regex), re.IGNORECASE | re.DOTALL)
if self.file_name_exclusion_regex_re
if self.file_name_exclusion_regex
else None
)
self.file_extension_allowlist = (
self.file_extension_allowlist_re = (
re.compile("|".join(self.file_extension_allowlist), re.IGNORECASE | re.DOTALL)
if self.file_extension_allowlist
else None
Expand Down Expand Up @@ -2710,14 +2710,14 @@ def folder_cleanup(self, downloads_id: str | None, folder: pathlib.Path):
if file.is_dir():
self.logger.trace("Folder Cleanup: File is a folder: %s", file)
continue
if self.file_extension_allowlist and (
(match := self.file_extension_allowlist.search(file.suffix)) and match.group()
if self.file_extension_allowlist_re and (
(match := self.file_extension_allowlist_re.search(file.suffix)) and match.group()
):
self.logger.trace("Folder Cleanup: File has an allowed extension: %s", file)
if self.file_is_probeable(file):
self.logger.trace("Folder Cleanup: File is a valid media type: %s", file)
probeable += 1
if not self.file_extension_allowlist:
if not self.file_extension_allowlist_re:
self.logger.trace("Folder Cleanup: File has an allowed extension: %s", file)
if self.file_is_probeable(file):
self.logger.trace("Folder Cleanup: File is a valid media type: %s", file)
Expand Down Expand Up @@ -3603,8 +3603,9 @@ def _process_single_torrent_process_files(
)
_remove_files.add(file.id)
total -= 1
elif self.file_extension_allowlist and not (
(match := self.file_extension_allowlist.search(file_path.suffix)) and match.group()
elif self.file_extension_allowlist_re and not (
(match := self.file_extension_allowlist_re.search(file_path.suffix))
and match.group()
):
self.logger.debug(
"Removing File: Not allowed | Extension: %s | %s (%s) | %s ",
Expand Down

0 comments on commit 0ed057a

Please sign in to comment.