mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-05 04:15:35 -04:00
Use rename when downloading
This commit is contained in:
parent
7233e6e5c3
commit
d416dc6618
@ -1,6 +1,7 @@
|
|||||||
require "http/client"
|
require "http/client"
|
||||||
require "json"
|
require "json"
|
||||||
require "csv"
|
require "csv"
|
||||||
|
require "../rename"
|
||||||
|
|
||||||
macro string_properties(names)
|
macro string_properties(names)
|
||||||
{% for name in names %}
|
{% for name in names %}
|
||||||
@ -72,13 +73,10 @@ module MangaDex
|
|||||||
gname = obj["group_name#{s}"].as_s
|
gname = obj["group_name#{s}"].as_s
|
||||||
@groups << {gid, gname}
|
@groups << {gid, gname}
|
||||||
end
|
end
|
||||||
@full_title = @title
|
|
||||||
unless @chapter.empty?
|
rename_rule = Rename::Rule.new \
|
||||||
@full_title = "Ch.#{@chapter} " + @full_title
|
Config.current.mangadex["chapter_rename_rule"].to_s
|
||||||
end
|
@full_title = rename rename_rule
|
||||||
unless @volume.empty?
|
|
||||||
@full_title = "Vol.#{@volume} " + @full_title
|
|
||||||
end
|
|
||||||
rescue e
|
rescue e
|
||||||
raise "failed to parse json: #{e}"
|
raise "failed to parse json: #{e}"
|
||||||
end
|
end
|
||||||
|
@ -313,7 +313,9 @@ module MangaDex
|
|||||||
end
|
end
|
||||||
@queue.set_pages chapter.pages.size, job
|
@queue.set_pages chapter.pages.size, job
|
||||||
lib_dir = @library_path
|
lib_dir = @library_path
|
||||||
manga_dir = File.join lib_dir, chapter.manga.title
|
rename_rule = Rename::Rule.new \
|
||||||
|
Config.current.mangadex["manga_rename_rule"].to_s
|
||||||
|
manga_dir = File.join lib_dir, chapter.manga.rename rename_rule
|
||||||
unless File.exists? manga_dir
|
unless File.exists? manga_dir
|
||||||
Dir.mkdir_p manga_dir
|
Dir.mkdir_p manga_dir
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user