mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -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 manga : Manga
|
||||||
property time = Time.local
|
property time = Time.local
|
||||||
property id : String
|
property id : String
|
||||||
|
property full_title = ""
|
||||||
property language = ""
|
property language = ""
|
||||||
property pages = [] of {String, String} # filename, url
|
property pages = [] of {String, String} # filename, url
|
||||||
property groups = [] of {Int32, String} # group_id, group_name
|
property groups = [] of {Int32, String} # group_id, group_name
|
||||||
@ -41,7 +42,7 @@ module MangaDex
|
|||||||
JSON.build do |json|
|
JSON.build do |json|
|
||||||
json.object do
|
json.object do
|
||||||
{% for name in ["id", "title", "volume", "chapter",
|
{% for name in ["id", "title", "volume", "chapter",
|
||||||
"language"] %}
|
"language", "full_title"] %}
|
||||||
json.field {{name}}, @{{name.id}}
|
json.field {{name}}, @{{name.id}}
|
||||||
{% end %}
|
{% end %}
|
||||||
json.field "time", @time.to_unix.to_s
|
json.field "time", @time.to_unix.to_s
|
||||||
@ -71,6 +72,13 @@ 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?
|
||||||
|
@full_title = "Ch.#{@chapter} " + @full_title
|
||||||
|
end
|
||||||
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user