lib/rmega/nodes/downloadable.rb in rmega-0.2.2 vs lib/rmega/nodes/downloadable.rb in rmega-0.2.4
- old
+ new
@@ -67,11 +67,11 @@
def download(path)
path = ::File.expand_path(path)
path = Dir.exists?(path) ? ::File.join(path, name) : path
- progress = Progress.new(filesize, caption: 'Download', filename: self.name)
+ progress = Progress.new(filesize, caption: 'Allocate', filename: self.name)
pool = Pool.new
@resumed_download = allocated?(path)
allocate(path)
@node_key = NodeKey.load(decrypted_file_key)
@@ -82,15 +82,15 @@
pool.process do
data = @resumed_download ? read_chunk(start, size) : nil
if data
chunk_macs[start] = calculate_chunck_mac(data) if options.file_integrity_check
- progress.increment(size, real: false)
+ progress.increment(size, real: false, caption: "Verify")
else
data = decrypt_chunk(start, download_chunk(start, size))
chunk_macs[start] = calculate_chunck_mac(data) if options.file_integrity_check
write_chunk(start, data)
- progress.increment(size)
+ progress.increment(size, caption: "Download")
end
end
end
# waits for the last running threads to finish