Use a cache for free diskspace when sync'ing all downloads.

This commit is contained in:
Jari Sundell
2026-06-18 16:45:55 +02:00
committed by GitHub
parent bf74686c29
commit acb02379b8
3 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -168,12 +168,14 @@ torrent::Object
apply_close_low_diskspace(int64_t arg, uint32_t skip_priority) {
bool closed = false;
torrent::FileList::cache_list cache;
for (auto download : *control->core()->download_list()) {
if (!download->is_downloading())
continue;
if (download->priority() >= skip_priority)
continue;
if (download->file_list()->free_diskspace() >= (uint64_t)arg)
if (download->file_list()->free_diskspace(cache) >= (uint64_t)arg)
continue;
control->core()->download_list()->close(download);