From bfb110e3d58f2f208a38bc4b321ce8ee17fb9324 Mon Sep 17 00:00:00 2001 From: tobiichiamane Date: Wed, 8 May 2019 15:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=9B=B4=E4=BD=8E=E5=88=86?= =?UTF-8?q?=E8=BE=A8=E7=8E=87=E7=9A=84=E6=96=B9=E5=BD=A2=E5=9B=BE=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=97=B6=E9=97=B4=E7=BA=BF=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PixivFSUWP/Data/IllustDetail.cs | 2 +- PixivFSUWP/Data/OverAll.cs | 4 ---- PixivFSUWP/IllustDetailPage.xaml.cs | 6 +++++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PixivFSUWP/Data/IllustDetail.cs b/PixivFSUWP/Data/IllustDetail.cs index c9c093c..ea9952e 100644 --- a/PixivFSUWP/Data/IllustDetail.cs +++ b/PixivFSUWP/Data/IllustDetail.cs @@ -52,7 +52,7 @@ public static IllustDetail FromJsonValue(JsonValue Source) foreach (var tool in tools) toret.Tools.Add(tool.AsString()); toret.CreateDate = Source.TryGetProperty("illust").Value.TryGetProperty("create_date").Value.AsString(); - toret.MediumUrl = Source.TryGetProperty("illust").Value.TryGetProperty("image_urls").Value.TryGetProperty("medium").Value.AsString(); + toret.MediumUrl = Source.TryGetProperty("illust").Value.TryGetProperty("image_urls").Value.TryGetProperty("square_medium").Value.AsString(); var pgCount = Source.TryGetProperty("illust").Value.TryGetProperty("page_count").Value.AsInteger(); toret.OriginalUrls = new List(); if (pgCount == 1) toret.OriginalUrls.Add(Source.TryGetProperty("illust").Value.TryGetProperty("meta_single_page").Value.TryGetProperty("original_image_url").Value.AsString()); diff --git a/PixivFSUWP/Data/OverAll.cs b/PixivFSUWP/Data/OverAll.cs index efe29c3..d8c8a23 100644 --- a/PixivFSUWP/Data/OverAll.cs +++ b/PixivFSUWP/Data/OverAll.cs @@ -133,8 +133,6 @@ public static PasswordCredential GetCredentialFromLocker(string resourceName) return credential; } - static UserActivitySession _currentActivity; - //时间线支持 public static async Task GenerateActivityAsync(string DisplayText, AdaptiveCard Card, Uri ActivationUri, string ActivityID) { @@ -144,8 +142,6 @@ public static async Task GenerateActivityAsync(string DisplayText, AdaptiveCard userActivity.VisualElements.Content = AdaptiveCardBuilder.CreateAdaptiveCardFromJson(Card.ToJson()); userActivity.ActivationUri = ActivationUri; await userActivity.SaveAsync(); - _currentActivity?.Dispose(); - _currentActivity = userActivity.CreateSession(); } } } diff --git a/PixivFSUWP/IllustDetailPage.xaml.cs b/PixivFSUWP/IllustDetailPage.xaml.cs index 4359462..18d56de 100644 --- a/PixivFSUWP/IllustDetailPage.xaml.cs +++ b/PixivFSUWP/IllustDetailPage.xaml.cs @@ -110,7 +110,11 @@ private async Task loadContent() MaxLines = 3 }); var build = SystemInformation.OperatingSystemVersion.Build; - if (build >= 18362) card.BackgroundImage = new AdaptiveBackgroundImage(new Uri(await Data.OverAll.GetDataUri(illust.MediumUrl))); + if (build >= 18362) + { + var data = await Data.OverAll.GetDataUri(illust.MediumUrl); + card.BackgroundImage = new AdaptiveBackgroundImage(new Uri(data)); + } await Data.OverAll.GenerateActivityAsync(illust.Title, card, new Uri(string.Format("pixiv://illust?id={0}", illustID)), illustID.ToString()); int counter = 0; foreach (var i in illust.OriginalUrls)