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

Commit

Permalink
修改细节以更贴近以前TryGetString方法的行为
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiichiamane committed May 12, 2020
1 parent 6a4aad4 commit c02c100
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/Collections/BookmarkIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = bookmarkres.NextUrl?.ToString();
nexturl = bookmarkres.NextUrl?.ToString() ?? "";
foreach (var recillust in bookmarkres.Illusts)
{
await Task.Run(() => pause.WaitOne());
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/Collections/CommentsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = commentres.NextUrl?.ToString();
nexturl = commentres.NextUrl?.ToString() ?? "";
foreach (var recillust in commentres.Comments)
{
await Task.Run(() => pause.WaitOne());
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/Collections/FollowingIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = followingres.NextUrl?.ToString();
nexturl = followingres.NextUrl?.ToString() ?? "";
foreach (var recillust in followingres.Illusts)
{
await Task.Run(() => pause.WaitOne());
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/Collections/RankingIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = rankingres.NextUrl?.ToString();
nexturl = rankingres.NextUrl?.ToString() ?? "";
foreach (var recillust in rankingres.Illusts)
{
await Task.Run(() => pause.WaitOne());
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/Collections/RecommendIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = recommendres.NextUrl?.ToString();
nexturl = recommendres.NextUrl?.ToString() ?? "";
foreach (var recillust in recommendres.Illusts)
{
await Task.Run(() => pause.WaitOne());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = searchres.NextUrl?.ToString();
nexturl = searchres.NextUrl?.ToString() ?? "";
foreach (var recillust in searchres.Illusts)
{
await Task.Run(() => pause.WaitOne());
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/Collections/UserIllustsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected async Task<LoadMoreItemsResult> LoadMoreItemsAsync(CancellationToken c
{
return toret;
}
nexturl = illustsres.NextUrl?.ToString();
nexturl = illustsres.NextUrl?.ToString() ?? "";
foreach (var recillust in illustsres.Illusts)
{
await Task.Run(() => pause.WaitOne());
Expand Down
6 changes: 3 additions & 3 deletions PixivFSUWP/Data/CurrentUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public static CurrentUser FromObject(PixivCS.Objects.ResponseUser Source)
toret.Email = Source.MailAddress;
toret.IsMailAuthorized = Source.IsMailAuthorized;
toret.IsPremium = Source.IsPremium;
toret.Avatar16 = Source.ProfileImageUrls.Px16X16?.ToString();
toret.Avatar50 = Source.ProfileImageUrls.Px50X50?.ToString();
toret.Avatar170 = Source.ProfileImageUrls.Px170X170?.ToString();
toret.Avatar16 = Source.ProfileImageUrls.Px16X16?.ToString() ?? "";
toret.Avatar50 = Source.ProfileImageUrls.Px50X50?.ToString() ?? "";
toret.Avatar170 = Source.ProfileImageUrls.Px170X170?.ToString() ?? "";
return toret;
}
}
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/IllustCommentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static IllustCommentItem FromObject(PixivCS.Objects.Comment Source)
toret.DateTime = Source.Date;
toret.UserName = Source.User.Name;
toret.UserAccount = Source.User.Account;
toret.AvatarUrl = Source.User.ProfileImageUrls.Medium?.ToString();
toret.AvatarUrl = Source.User.ProfileImageUrls.Medium?.ToString() ?? "";
if (Source.ParentComment.CommentComment != null)
{
//有父级评论
Expand Down
4 changes: 2 additions & 2 deletions PixivFSUWP/Data/IllustDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static IllustDetail FromObject(PixivCS.Objects.IllustDetail Source)
toret.AuthorID = (int)Source.Illust.User.Id;
toret.Author = Source.Illust.User.Name;
toret.AuthorAccount = Source.Illust.User.Account;
toret.AuthorAvatarUrl = Source.Illust.User.ProfileImageUrls.Medium?.ToString();
toret.AuthorAvatarUrl = Source.Illust.User.ProfileImageUrls.Medium?.ToString() ?? "";
toret.IsUserFollowed = Source.Illust.User.IsFollowed.HasValue ? Source.Illust.User.IsFollowed.Value : false;
var tags = Source.Illust.Tags;
toret.Tags = new List<string>();
Expand All @@ -52,7 +52,7 @@ public static IllustDetail FromObject(PixivCS.Objects.IllustDetail Source)
foreach (var tool in tools)
toret.Tools.Add(tool);
toret.CreateDate = Source.Illust.CreateDate;
toret.MediumUrl = Source.Illust.ImageUrls.SquareMedium?.ToString();
toret.MediumUrl = Source.Illust.ImageUrls.SquareMedium?.ToString() ?? "";
var pgCount = (int)Source.Illust.PageCount;
toret.OriginalUrls = new List<string>();
if (pgCount == 1) toret.OriginalUrls.Add(Source.Illust.MetaSinglePage.OriginalImageUrl?.ToString());
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/UgoiraHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static async Task<Ugoira> GetUgoiraAsync(string IllustID)
framefiles.Add(file);
framedelays.Add(file, (int)i.Delay);
}
var zipurl = res.UgoiraMetadataUgoiraMetadata.ZipUrls.Medium?.ToString();
var zipurl = res.UgoiraMetadataUgoiraMetadata.ZipUrls.Medium?.ToString() ?? "";
using (var zipfile = await OverAll.DownloadImage(zipurl))
{
using (ZipArchive ziparc = new ZipArchive(zipfile, ZipArchiveMode.Read))
Expand Down
2 changes: 1 addition & 1 deletion PixivFSUWP/Data/WaterfallItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static WaterfallItem FromObject(PixivCS.Objects.UserPreviewIllust Source)
toret.Id = (int)Source.Id;
toret.Title = Source.Title;
toret.Author = Source.User.Name;
toret.ImageUri = Source.ImageUrls.Medium?.ToString();
toret.ImageUri = Source.ImageUrls.Medium?.ToString() ?? "";
toret.Stars = (int)Source.TotalBookmarks;
toret.Pages = (int)Source.PageCount;
toret.IsBookmarked = Source.IsBookmarked;
Expand Down

0 comments on commit c02c100

Please sign in to comment.