Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
修正问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed May 18, 2019
1 parent f73a40a commit 11aba5e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/CurrentUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CurrentUser
public static CurrentUser FromJsonValue(JsonObject Source)
{
CurrentUser toret = new CurrentUser();
toret.ID = Convert.ToInt32(Source["id"].GetString());
toret.ID = (int)Source["id"].GetNumber();
toret.Username = Source["name"].GetString();
toret.UserAccount = Source["account"].GetString();
toret.Email = Source["mail_address"].GetString();
Expand Down
18 changes: 9 additions & 9 deletions PixivFSUWP/Data/IllustDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public class IllustDetail
public static IllustDetail FromJsonValue(JsonObject Source)
{
IllustDetail toret = new IllustDetail();
toret.IllustID = Convert.ToInt32(Source["illust"].GetObject()["id"].GetString());
toret.IllustID = (int)Source["illust"].GetObject()["id"].GetNumber();
toret.Title = Source["illust"].GetObject()["title"].GetString();
toret.Type = Source["illust"].GetObject()["type"].GetString();
toret.Caption = Source["illust"].GetObject()["caption"].GetString();
toret.AuthorID = Convert.ToInt32(Source["illust"].GetObject()["user"].GetObject()["id"].GetString());
toret.AuthorID = (int)Source["illust"].GetObject()["user"].GetObject()["id"].GetNumber();
toret.Author = Source["illust"].GetObject()["user"].GetObject()["name"].GetString();
toret.AuthorAccount = Source["illust"].GetObject()["user"].GetObject()["account"].GetString();
toret.AuthorAvatarUrl = Source["illust"].GetObject()["user"].GetObject()["profile_image_urls"].GetObject()["medium"].GetString();
Expand All @@ -53,7 +53,7 @@ public static IllustDetail FromJsonValue(JsonObject Source)
toret.Tools.Add(tool.GetString());
toret.CreateDate = Source["illust"].GetObject()["create_date"].GetString();
toret.MediumUrl = Source["illust"].GetObject()["image_urls"].GetObject()["square_medium"].GetString();
var pgCount = Convert.ToInt32(Source["illust"].GetObject()["page_count"].GetString());
var pgCount = (int)Source["illust"].GetObject()["page_count"].GetNumber();
toret.OriginalUrls = new List<string>();
if (pgCount == 1) toret.OriginalUrls.Add(Source["illust"].GetObject()["meta_single_page"].GetObject()["original_image_url"].GetString());
else
Expand All @@ -62,13 +62,13 @@ public static IllustDetail FromJsonValue(JsonObject Source)
foreach (var page in pages)
toret.OriginalUrls.Add(page.GetObject()["image_urls"].GetObject()["original"].GetString());
}
toret.Width = Convert.ToInt32(Source["illust"].GetObject()["width"].GetString());
toret.Height = Convert.ToInt32(Source["illust"].GetObject()["height"].GetString());
toret.SanityLevel = Convert.ToInt32(Source["illust"].GetObject()["sanity_level"].GetString());
toret.TotalView = Convert.ToInt32(Source["illust"].GetObject()["total_view"].GetString());
toret.TotalBookmarks = Convert.ToInt32(Source["illust"].GetObject()["total_bookmarks"].GetString());
toret.Width = (int)Source["illust"].GetObject()["width"].GetNumber();
toret.Height = (int)Source["illust"].GetObject()["height"].GetNumber();
toret.SanityLevel = (int)Source["illust"].GetObject()["sanity_level"].GetNumber();
toret.TotalView = (int)Source["illust"].GetObject()["total_view"].GetNumber();
toret.TotalBookmarks = (int)Source["illust"].GetObject()["total_bookmarks"].GetNumber();
toret.IsBookmarked = Source["illust"].GetObject()["is_bookmarked"].GetBoolean();
toret.TotalComments = Convert.ToInt32(Source["illust"].GetObject()["total_comments"].GetString());
toret.TotalComments = (int)Source["illust"].GetObject()["total_comments"].GetNumber();
return toret;
}
}
Expand Down
24 changes: 12 additions & 12 deletions PixivFSUWP/Data/UserDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static UserDetail FromJsomValue(JsonObject Source)
{
UserDetail toret = new UserDetail();
var user = Source["user"].GetObject();
toret.ID = Convert.ToInt32(user["id"].GetString());
toret.ID = (int)user["id"].GetNumber();
toret.Name = user["name"].GetString();
toret.Account = user["account"].GetString();
toret.AvatarUrl = user["profile_image_urls"].GetObject()["medium"].GetString();
Expand All @@ -74,20 +74,20 @@ public static UserDetail FromJsomValue(JsonObject Source)
toret.Gender = profile["gender"].GetString();
toret.Birth = profile["birth"].GetString();
toret.BirthDay = profile["birth_day"].GetString();
toret.BirthYear = Convert.ToInt32(profile["birth_year"].GetString());
toret.BirthYear = (int)profile["birth_year"].GetNumber();
toret.Region = profile["region"].GetString();
toret.AddressID = Convert.ToInt32(profile["address_id"].GetString());
toret.AddressID = (int)profile["address_id"].GetNumber();
toret.CountryCode = profile["country_code"].GetString();
toret.Job = profile["job"].GetString();
toret.JobID = Convert.ToInt32(profile["job_id"].GetString());
toret.TotalFollowUsers = Convert.ToInt32(profile["total_follow_users"].GetString());
toret.TotalMyPixivUsers = Convert.ToInt32(profile["total_mypixiv_users"].GetString());
toret.TotalIllusts = Convert.ToInt32(profile["total_illusts"].GetString());
toret.TotalManga = Convert.ToInt32(profile["total_manga"].GetString());
toret.TotalNovels = Convert.ToInt32(profile["total_novels"].GetString());
toret.TotalIllustBookmarksPublic = Convert.ToInt32(profile["total_illust_bookmarks_public"].GetString());
toret.TotalIllustSeries = Convert.ToInt32(profile["total_illust_series"].GetString());
toret.TotalNovelSeries = Convert.ToInt32(profile["total_novel_series"].GetString());
toret.JobID = (int)profile["job_id"].GetNumber();
toret.TotalFollowUsers = (int)profile["total_follow_users"].GetNumber();
toret.TotalMyPixivUsers = (int)profile["total_mypixiv_users"].GetNumber();
toret.TotalIllusts = (int)profile["total_illusts"].GetNumber();
toret.TotalManga = (int)profile["total_manga"].GetNumber();
toret.TotalNovels = (int)profile["total_novels"].GetNumber();
toret.TotalIllustBookmarksPublic = (int)profile["total_illust_bookmarks_public"].GetNumber();
toret.TotalIllustSeries = (int)profile["total_illust_series"].GetNumber();
toret.TotalNovelSeries = (int)profile["total_novel_series"].GetNumber();
toret.BackgroundImage = profile["background_image_url"].GetString();
toret.TwitterAccount = profile["twitter_account"].GetString();
toret.TwitterUrl = profile["twitter_url"].GetString();
Expand Down
11 changes: 6 additions & 5 deletions PixivFSUWP/Data/WaterfallItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ public class WaterfallItem
public static WaterfallItem FromJsonValue(JsonObject Source)
{
var toret = new WaterfallItem();
toret.Id = Convert.ToInt32(Source["id"].GetString());
var test = Source["id"];
toret.Id = (int)Source["id"].GetNumber();
toret.Title = Source["title"].GetString();
toret.Author = Source["user"].GetObject()["name"].GetString();
toret.ImageUri = Source["image_urls"].GetObject()["medium"].GetString();
toret.Stars = Convert.ToInt32(Source["total_bookmarks"].GetString());
toret.Pages = Convert.ToInt32(Source["page_count"].GetString());
toret.Stars = (int)Source["total_bookmarks"].GetNumber();
toret.Pages = (int)Source["page_count"].GetNumber();
toret.IsBookmarked = Source["is_bookmarked"].GetBoolean();
toret.Width = Convert.ToInt32(Source["width"].GetString());
toret.Height = Convert.ToInt32(Source["height"].GetString());
toret.Width = (int)Source["width"].GetNumber();
toret.Height = (int)Source["height"].GetNumber();
return toret;
}
}
Expand Down

0 comments on commit 11aba5e

Please sign in to comment.