Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
[patch] allow setting FileExtensionAllowlist to an empty list to al…
Browse files Browse the repository at this point in the history
…low all file extensions
  • Loading branch information
Drapersniper committed Feb 26, 2022
1 parent de1bb5b commit e1f2785
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,10 @@ def folder_cleanup(self) -> None:
if file.is_dir():
self.logger.trace("Folder Cleanup: File is a folder: %s", file)
continue
if file.suffix.lower() in self.file_extension_allowlist:
if (
file.suffix.lower() in self.file_extension_allowlist
or not self.file_extension_allowlist
):
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 @@ -1960,7 +1963,6 @@ def _process_single_torrent_queued_upload(
def _process_single_torrent_stalled_torrent(
self, torrent: qbittorrentapi.TorrentDictionary, extra: str
):

# Process torrents who have stalled at this point, only mark for
# deletion if they have been added more than "IgnoreTorrentsYoungerThan"
# seconds ago
Expand Down Expand Up @@ -2287,7 +2289,10 @@ def _process_single_torrent_process_files(
)
_remove_files.add(file.id)
total -= 1
elif file_path.suffix.lower() not in self.file_extension_allowlist:
elif (
self.file_extension_allowlist
and file_path.suffix.lower() not in self.file_extension_allowlist
):
self.logger.debug(
"Removing File: Not allowed | Extension: %s | %s (%s) | %s ",
file_path.suffix,
Expand Down
2 changes: 1 addition & 1 deletion qBitrr/gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def _gen_default_torrent_table(category: str, cat_default: Table):
torrent_table.add(
comment(
"Only files with these extensions will be allowed to be downloaded, "
"comma separated strings."
"comma separated strings, leave it empty to allow all extensions"
)
)
torrent_table.add(
Expand Down

0 comments on commit e1f2785

Please sign in to comment.