Beispiel #1
0
        public async Task HandleRequestAsync(TvShow tvShow, AllTvSeasons selectedSeason)
        {
            await _userInterface.DisplayTvShowDetailsAsync(tvShow);

            var wasRequested = await _userInterface.GetTvShowRequestConfirmation(selectedSeason);

            if (wasRequested)
            {
                await _requester.RequestTvShowAsync(_user.Username, tvShow, selectedSeason);

                foreach (var season in tvShow.Seasons.OfType <NormalTvSeason>().Where(x => !x.IsAvailable))
                {
                    _notificationRequestRepository.AddSeasonNotification(_user.UserId, tvShow.TheTvDbId, season);
                }

                await _userInterface.DisplayRequestSuccessForSeasonAsync(selectedSeason);
            }
        }
        public async Task HandleRequestAsync(TvShow tvShow, NormalTvSeason selectedSeason)
        {
            await _userInterface.DisplayTvShowDetailsAsync(tvShow);

            if (selectedSeason.IsRequested)
            {
                await RequestNotificationsForSeasonAsync(tvShow, selectedSeason);
            }
            else
            {
                var wasRequested = await _userInterface.GetTvShowRequestConfirmation(selectedSeason);

                if (wasRequested)
                {
                    await _requester.RequestTvShowAsync(_user.Username, tvShow, selectedSeason);

                    _notificationRequestRepository.AddSeasonNotification(_user.UserId, tvShow.TheTvDbId, selectedSeason);
                    await _userInterface.DisplayRequestSuccessForSeasonAsync(selectedSeason);
                }
            }
        }