예제 #1
0
        private void FeedManager_FeedUpdated(object sender, FeedUpdateEventArgs e)
        {
            try
            {
                NowUpdate.Value = true;

                if (e.Feed.Id != Feed.Id)
                {
                    return;
                }

                foreach (var feed in e.Items)
                {
                    var video = feed.Item1;

                    // 視聴済みの動画は表示しない
                    var playedHistory = Database.VideoPlayedHistoryDb.Get(video.VideoId);
                    if (playedHistory?.PlayCount != 0)
                    {
                        continue;
                    }

                    // 前回チェックした日時よりも古い動画は表示しない
                    if (video.PostedAt < Feed.CheckedAt)
                    {
                        continue;
                    }

                    FeedVideos.Add(new FeedVideoInfoControlViewModel(video, feed.Item2));
                }

                RaisePropertyChanged(nameof(FeedVideos));
            }
            finally
            {
                NowUpdate.Value = false;
            }
        }
예제 #2
0
        internal async void UpdateFeedVideos()
        {
            FeedVideos.Clear();

            await FeedManager.RefreshFeedItemsAsync(Feed);
        }