summarylogtreecommitdiffstats
path: root/ps-close_lowdisk_normal_all.patch
diff options
context:
space:
mode:
authorxsmile2020-03-20 12:07:51 +0100
committerxsmile2020-03-20 12:07:51 +0100
commit3c12c743c253ea142bdc9878e0875b3f34d43f1d (patch)
treed78800eaf07c681634e4f17fbb35a39d39739b8e /ps-close_lowdisk_normal_all.patch
parent617f58f2c545bb2b4a239d8faa656757c5939ea1 (diff)
downloadaur-3c12c743c253ea142bdc9878e0875b3f34d43f1d.tar.gz
update
Diffstat (limited to 'ps-close_lowdisk_normal_all.patch')
-rw-r--r--ps-close_lowdisk_normal_all.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/ps-close_lowdisk_normal_all.patch b/ps-close_lowdisk_normal_all.patch
new file mode 100644
index 00000000000..3a7f55f4147
--- /dev/null
+++ b/ps-close_lowdisk_normal_all.patch
@@ -0,0 +1,28 @@
+--- a/src/command_events.cc
++++ b/src/command_events.cc
+@@ -216,7 +216,7 @@ void apply_import(const std::string& path) { if (!rpc::parse_command_file(pa
+ void apply_try_import(const std::string& path) { if (!rpc::parse_command_file(path)) control->core()->push_log_std("Could not read resource file: " + path); }
+
+ torrent::Object
+-apply_close_low_diskspace(int64_t arg) {
++apply_close_low_diskspace(int64_t arg, uint32_t skip_prio) {
+ core::DownloadList* downloadList = control->core()->download_list();
+
+ bool closed = false;
+@@ -224,7 +224,7 @@ apply_close_low_diskspace(int64_t arg) {
+
+ while ((itr = std::find_if(itr, downloadList->end(), std::mem_fun(&core::Download::is_downloading)))
+ != downloadList->end()) {
+- if ((*itr)->file_list()->free_diskspace() < (uint64_t)arg) {
++ if ((*itr)->priority() < skip_prio && (*itr)->file_list()->free_diskspace() < (uint64_t)arg) {
+ downloadList->close(*itr);
+
+ (*itr)->set_hash_failed(true);
+@@ -391,5 +391,6 @@ initialize_command_events() {
+ core::Manager::create_quiet | core::Manager::create_start | core::Manager::create_raw_data));
+
+- CMD2_ANY_VALUE ("close_low_diskspace", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2));
++ CMD2_ANY_VALUE ("close_low_diskspace", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2, 99));
++ CMD2_ANY_VALUE ("close_low_diskspace.normal", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2, 3));
+
+ CMD2_ANY_LIST ("download_list", tr1::bind(&apply_download_list, tr1::placeholders::_2));