Added parallel downloads setting (not in gui options yet), added a thread pool for downloading multiple packages at once- quite helpful for TSR 😁, fixed download resuming (used wrong file mode...)

This commit is contained in:
2021-12-23 10:56:28 -06:00
parent 47a22311bb
commit 9707110972
5 changed files with 112 additions and 14 deletions

View File

@@ -55,9 +55,9 @@ class W3DHub
create_directories(path)
file = File.open(path, "ab")
if (start_from_bytes > 0)
headers["Range"] = "bytes=#{start_from_bytes}-#{package.size}"
file = File.open(path, start_from_bytes.positive? ? "r+b" : "wb")
if (start_from_bytes.positive?)
headers["Range"] = "bytes=#{start_from_bytes}-"
file.pos = start_from_bytes
end