|
@@ -65,25 +65,24 @@ def savefileprogress(name, full_name, file, item):
|
|
|
if item.bytes is not None:
|
|
if item.bytes is not None:
|
|
|
bar = console.ProgressBar(total=item.bytes)
|
|
bar = console.ProgressBar(total=item.bytes)
|
|
|
|
|
|
|
|
- for chunk in file.iter_content(chunk_size=4096):
|
|
|
|
|
- progress += len(chunk)
|
|
|
|
|
- f.write(chunk)
|
|
|
|
|
- bar.report_progress(progress=progress)
|
|
|
|
|
|
|
+ for chunk in file.iter_content(chunk_size=1024):
|
|
|
|
|
+ if chunk:
|
|
|
|
|
+ progress += len(chunk)
|
|
|
|
|
+ f.write(chunk)
|
|
|
|
|
+ bar.report_progress(progress=progress)
|
|
|
|
|
+ bar.destroy()
|
|
|
|
|
|
|
|
else:
|
|
else:
|
|
|
- bar = console.ProgressBar()
|
|
|
|
|
f.write(file.content)
|
|
f.write(file.content)
|
|
|
|
|
|
|
|
- bar.destroy()
|
|
|
|
|
|
|
+ tags = tagging.search_tags(item)
|
|
|
|
|
|
|
|
- tags = tagging.search_tags(item)
|
|
|
|
|
|
|
+ if tags is not None:
|
|
|
|
|
+ item.link_tag_item(tags)
|
|
|
|
|
|
|
|
- if tags is not None:
|
|
|
|
|
- item.link_tag_item(tags)
|
|
|
|
|
|
|
+ tagging.download_artwork(tags)
|
|
|
|
|
|
|
|
- tagging.download_artwork(tags)
|
|
|
|
|
-
|
|
|
|
|
- tagging.write_tags_to_file(f, item)
|
|
|
|
|
|
|
+ tagging.write_tags_to_file(full_name, item)
|
|
|
|
|
|
|
|
full_save_name = '{0}/{1}'.format(Settings.SaveDir, name)
|
|
full_save_name = '{0}/{1}'.format(Settings.SaveDir, name)
|
|
|
os.rename(full_name, full_save_name)
|
|
os.rename(full_name, full_save_name)
|