Ejemplo n.º 1
0
        /// <summary>
        /// Отфильтровать серии от просмотренных и не выбранных
        /// </summary>
        private void FilterCheckedEpisodes()
        {
            var count           = 0;
            var approximateTime = new TimeSpan();

            foreach (var ce in CheckedEpisodes.ToList())
            {
                var option = ce.EpisodeOptions
                             .FirstOrDefault(eo => eo.CartoonVoiceOverId == ce.CartoonVoiceOver.CartoonVoiceOverId);

                if (option == null)
                {
                    CheckedEpisodes.Remove(ce);

                    continue;
                }

                if (DateTime.Now.Subtract(option.LastDateViewed) >
                    GeneralSettings.NonRepeatTime)
                {
                    approximateTime += option.Duration;
                    count++;
                    continue;
                }

                CheckedEpisodes.Remove(ce);
            }

            ApproximateEpisodeDuration =
                new TimeSpan(0, 0,
                             (int)(approximateTime.TotalSeconds / count));

            NotifyOfPropertyChange(() => EndTime);
            NotifyOfPropertyChange(() => EndDate);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Создает список (по порядку, перемешанный (с цепочкой эпизодов)).
        /// </summary>
        private void CreateList()
        {
            if (AppVal.WS.RandomWatching)
            {
                _checkedEpisodes = ShuffleEpisodes(_checkedEpisodes.ToList(), AppVal.WS.RandomMixCount ?? 1);

                if (AppVal.WS.IsEpisodeChainActive)
                {
                    _checkedEpisodes = CreateEpisodeChains(CheckedEpisodes.ToList());
                }
            }
            else
            {
                _checkedEpisodes = CheckedEpisodes.OrderBy(ce => ce.FullNumber).ToList();
            }

            NotifyOfPropertyChange(() => CheckedEpisodes);
        }