pixiv: fix nil commentary fields to empty string.

This commit is contained in:
evazion
2017-06-16 18:41:40 -05:00
parent 8b8b4fde71
commit c638ff2e9c

View File

@@ -94,8 +94,8 @@ class PixivApiClient
@user_id = json["user"]["id"] @user_id = json["user"]["id"]
@moniker = json["user"]["account"] @moniker = json["user"]["account"]
@page_count = json["page_count"].to_i @page_count = json["page_count"].to_i
@artist_commentary_title = json["title"] @artist_commentary_title = json["title"].to_s
@artist_commentary_desc = json["caption"] @artist_commentary_desc = json["caption"].to_s
@tags = [json["tags"], json["tools"]].flatten.compact.reject {|x| x =~ /^http:/} @tags = [json["tags"], json["tools"]].flatten.compact.reject {|x| x =~ /^http:/}
if page_count > 1 if page_count > 1