From b1f16857fc6d6c0102d1f52f721611f2c44e4350 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 10 Mar 2018 01:59:55 +0100 Subject: [PATCH] Support per-site auto download bigfile size limit --- plugins/Bigfile/BigfilePlugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Bigfile/BigfilePlugin.py b/plugins/Bigfile/BigfilePlugin.py index 3d1382cc..5b40ece3 100644 --- a/plugins/Bigfile/BigfilePlugin.py +++ b/plugins/Bigfile/BigfilePlugin.py @@ -501,7 +501,8 @@ class WorkerManagerPlugin(object): if not self.site.storage.isFile(piecemap_inner_path): # Start download piecemap piecemap_task = super(WorkerManagerPlugin, self).addTask(piecemap_inner_path, priority=30) - if "|" not in inner_path and self.site.isDownloadable(inner_path) and file_info["size"] / 1024 / 1024 <= config.autodownload_bigfile_size_limit: + autodownload_bigfile_size_limit = self.site.settings.get("autodownload_bigfile_size_limit", config.autodownload_bigfile_size_limit) + if "|" not in inner_path and self.site.isDownloadable(inner_path) and file_info["size"] / 1024 / 1024 <= autodownload_bigfile_size_limit: gevent.spawn_later(0.1, self.site.needFile, inner_path + "|all") # Download all pieces if "|" in inner_path: