mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-05 04:15:35 -04:00
Name partially downloaded cbz files .part
(#90)
This commit is contained in:
parent
cd7782ba1e
commit
5be4f51d7e
@ -319,7 +319,7 @@ module MangaDex
|
|||||||
unless File.exists? manga_dir
|
unless File.exists? manga_dir
|
||||||
Dir.mkdir_p manga_dir
|
Dir.mkdir_p manga_dir
|
||||||
end
|
end
|
||||||
zip_path = File.join manga_dir, "#{job.title}.cbz"
|
zip_path = File.join manga_dir, "#{job.title}.cbz.part"
|
||||||
|
|
||||||
# Find the number of digits needed to store the number of pages
|
# Find the number of digits needed to store the number of pages
|
||||||
len = Math.log10(chapter.pages.size).to_i + 1
|
len = Math.log10(chapter.pages.size).to_i + 1
|
||||||
@ -369,9 +369,12 @@ module MangaDex
|
|||||||
Logger.debug "Download completed. " \
|
Logger.debug "Download completed. " \
|
||||||
"#{fail_count}/#{page_jobs.size} failed"
|
"#{fail_count}/#{page_jobs.size} failed"
|
||||||
writer.close
|
writer.close
|
||||||
Logger.debug "cbz File created at #{zip_path}"
|
filename = File.join File.dirname(zip_path), File.basename(zip_path,
|
||||||
|
".part")
|
||||||
|
File.rename zip_path, filename
|
||||||
|
Logger.debug "cbz File created at #{filename}"
|
||||||
|
|
||||||
zip_exception = validate_archive zip_path
|
zip_exception = validate_archive filename
|
||||||
if !zip_exception.nil?
|
if !zip_exception.nil?
|
||||||
@queue.add_message "The downloaded archive is corrupted. " \
|
@queue.add_message "The downloaded archive is corrupted. " \
|
||||||
"Error: #{zip_exception}", job
|
"Error: #{zip_exception}", job
|
||||||
|
Loading…
x
Reference in New Issue
Block a user