diff --git a/Pixiview/Illust/ViewIllustPage.xaml.cs b/Pixiview/Illust/ViewIllustPage.xaml.cs index 5fd0a75..d14b704 100644 --- a/Pixiview/Illust/ViewIllustPage.xaml.cs +++ b/Pixiview/Illust/ViewIllustPage.xaml.cs @@ -131,6 +131,7 @@ namespace Pixiview.Illust if (illust != null) { + IsAnimateSliderVisible = illust.IsAnimeVisible; LoadIllust(illust); } } @@ -352,9 +353,6 @@ namespace Pixiview.Illust } } - var isAnime = illustItem.IllustType == IllustType.Anime; - IsAnimateSliderVisible = isAnime; - Task.Run(() => DoLoadImage(0, true)); if (items.Length > 1) { @@ -363,7 +361,7 @@ namespace Pixiview.Illust DoLoadImage(i); }); } - else if (isAnime) + else if (illustItem.IsAnimeVisible) { // anime ugoiraData = Stores.LoadIllustUgoiraData(illustItem.Id); diff --git a/Pixiview/Utils/HttpUtility.cs b/Pixiview/Utils/HttpUtility.cs index be7507b..96c3c72 100644 --- a/Pixiview/Utils/HttpUtility.cs +++ b/Pixiview/Utils/HttpUtility.cs @@ -299,7 +299,7 @@ namespace Pixiview.Utils private readonly IllustUgoiraBody ugoira; private readonly IllustDetailItem detailItem; private readonly ImageSource[] frames; - private readonly Timer timer; + private Timer timer; private int index = 0; public bool IsPlaying { get; private set; } @@ -329,6 +329,7 @@ namespace Pixiview.Utils if (timer != null) { timer.Dispose(); + timer = null; } } @@ -336,7 +337,7 @@ namespace Pixiview.Utils { lock (sync) { - if (IsPlaying == flag) + if (timer == null || IsPlaying == flag) { return; } @@ -409,7 +410,7 @@ namespace Pixiview.Utils index = i; lock (sync) { - if (IsPlaying) + if (timer != null && IsPlaying) { timer.Change(info.delay, Timeout.Infinite); }