mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 19:05:32 -04:00
Add @full_title to MangaDex::Chapter
This commit is contained in:
parent
77864afa67
commit
e3d505d62b
@ -30,6 +30,7 @@ module MangaDex
|
||||
property manga : Manga
|
||||
property time = Time.local
|
||||
property id : String
|
||||
property full_title = ""
|
||||
property language = ""
|
||||
property pages = [] of {String, String} # filename, url
|
||||
property groups = [] of {Int32, String} # group_id, group_name
|
||||
@ -41,7 +42,7 @@ module MangaDex
|
||||
JSON.build do |json|
|
||||
json.object do
|
||||
{% for name in ["id", "title", "volume", "chapter",
|
||||
"language"] %}
|
||||
"language", "full_title"] %}
|
||||
json.field {{name}}, @{{name.id}}
|
||||
{% end %}
|
||||
json.field "time", @time.to_unix.to_s
|
||||
@ -71,6 +72,13 @@ module MangaDex
|
||||
gname = obj["group_name#{s}"].as_s
|
||||
@groups << {gid, gname}
|
||||
end
|
||||
@full_title = @title
|
||||
unless @chapter.empty?
|
||||
@full_title = "Ch.#{@chapter} " + @full_title
|
||||
end
|
||||
unless @volume.empty?
|
||||
@full_title = "Vol.#{@volume} " + @full_title
|
||||
end
|
||||
rescue e
|
||||
raise "failed to parse json: #{e}"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user