Ejemplo n.º 1
0
        public Task NotifyForNewRequestAsync(string userId, TvShow tvShow, TvSeason selectedSeason)
        {
            if (_automaticNotificationForNewRequests)
            {
                _notificationsRepository.AddSeasonNotification(userId, tvShow.TheTvDbId, selectedSeason);
            }

            return(Task.CompletedTask);
        }
Ejemplo n.º 2
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);
            }
        }