From 28ac5c7a00c6944f36bd8e3d63ac25c89ac2016b Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Fri, 28 Feb 2020 17:17:04 +0000 Subject: [PATCH] Formatting in mangadex/api.cr --- src/mangadex/api.cr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mangadex/api.cr b/src/mangadex/api.cr index 924d27e..2802d39 100644 --- a/src/mangadex/api.cr +++ b/src/mangadex/api.cr @@ -25,7 +25,8 @@ module MangaDex property pages = [] of {String, String} # filename, url property groups = [] of {Int32, String} # group_id, group_name - def initialize(@id, json_obj : JSON::Any, @manga, lang : Hash(String, String)) + def initialize(@id, json_obj : JSON::Any, @manga, lang : + Hash(String, String)) self.parse_json json_obj, lang end def to_info_json @@ -147,12 +148,12 @@ module MangaDex raise "" if obj["status"] != "OK" server = obj["server"].as_s hash = obj["hash"].as_s - chapter.pages = obj["page_array"].as_a.map{|fn| + chapter.pages = obj["page_array"].as_a.map do |fn| { fn.as_s, "#{server}#{hash}/#{fn.as_s}" } - } + end rescue raise "Failed to parse JSON" end