void ResetCacheRequests(Interfaces.IVideoContent video, CacheRequest cacheRequest) { ClearHandleProgress(); _ = _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { // Note: 表示バグのワークアラウンドのため必要 CacheRequest = null; if (cacheRequest?.CacheState == NicoVideoCacheState.Downloading) { var progress = await _cacheManager.GetCacheProgress(video.Id); if (progress != null) { HandleProgress(progress); } cacheRequest = new CacheRequest(cacheRequest, cacheRequest.CacheState) { PriorityQuality = progress.Quality }; } if (cacheRequest?.CacheState == NicoVideoCacheState.Cached && cacheRequest.PriorityQuality == NicoVideoQuality.Unknown) { var cached = await _cacheManager.GetCachedAsync(video.Id); if (cached?.Any() ?? false) { cacheRequest = new CacheRequest(cacheRequest, cacheRequest.CacheState) { PriorityQuality = cached.First().Quality }; } } CacheRequest = cacheRequest; }); }