Skip to content

Commit

Permalink
[release] File extension regex update
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Oct 9, 2023
1 parent f925fb7 commit 44f55ed
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ def __init__(
self.file_extension_allowlist = CONFIG.get(
f"{name}.Torrent.FileExtensionAllowlist", fallback=[]
)
self.logger.debug("file_extension_allowlist: ", self.file_extension_allowlist)
for ext in self.file_extension_allowlist:
if ext[0] != "\\":
self.file_extension_allowlist[self.file_extension_allowlist.index(ext)] = (
"\\" + ext
)
self.logger.debug("file_extension_allowlist: ", self.file_extension_allowlist)
self.auto_delete = CONFIG.get(f"{name}.Torrent.AutoDelete", fallback=False)

self.remove_dead_trackers = CONFIG.get(
Expand Down Expand Up @@ -2933,7 +2940,11 @@ def _process_single_torrent_process_files(
total -= 1
elif (
self.file_extension_allowlist
and file_path.suffix.lower() not in self.file_extension_allowlist
and (
(match := self.file_extension_allowlist.search(file_path.suffix))
and match.group()
)
# and file_path.suffix.lower() not in self.file_extension_allowlist
):
self.logger.debug(
"Removing File: Not allowed | Extension: %s | %s (%s) | %s ",
Expand Down

0 comments on commit 44f55ed

Please sign in to comment.