Пример #1
0
        public Task NotifyForNewRequestAsync(string userId, TvShow tvShow, TvSeason selectedSeason)
        {
            if (_automaticNotificationForNewRequests)
            {
                _notificationsRepository.AddSeasonNotification(userId, tvShow.TheTvDbId, selectedSeason);
            }

            return(Task.CompletedTask);
        }
Пример #2
0
        private async Task HandleSeasonSelectionAsync(TvShow tvShow, TvSeason selectedSeason)
        {
            switch (selectedSeason)
            {
            case FutureTvSeasons futureTvSeasons:
                await new FutureSeasonsRequestingWorkflow(_searcher, _requester, _userInterface, _tvShowNotificationWorkflow)
                .HandleSelectionAsync(new TvShowRequest(_user, _categoryId), tvShow, futureTvSeasons);
                break;

            case AllTvSeasons allTvSeasons:
                await new AllSeasonsRequestingWorkflow(_searcher, _requester, _userInterface, _tvShowNotificationWorkflow)
                .HandleSelectionAsync(new TvShowRequest(_user, _categoryId), tvShow, allTvSeasons);
                break;

            case NormalTvSeason normalTvSeason:
                await new NormalTvSeasonRequestingWorkflow(_searcher, _requester, _userInterface, _tvShowNotificationWorkflow)
                .HandleSelectionAsync(new TvShowRequest(_user, _categoryId), tvShow, normalTvSeason);
                break;

            default:
                throw new Exception($"Could not handle season of type \"{selectedSeason.GetType().Name}\"");
            }
        }
Пример #3
0
 public Task WarnAlreadyNotifiedForSeasonsAsync(TvShow tvShow, TvSeason requestedSeason)
 {
     return(Task.CompletedTask);
 }
Пример #4
0
 public Task <bool> GetTvShowRequestConfirmationAsync(TvSeason season)
 {
     return(Task.FromResult(true));
 }
Пример #5
0
        public async Task DisplayRequestSuccessForSeasonAsync(TvSeason selectedSeason)
        {
            await _tvShowUserInterface.DisplayTvShowDetailsAsync(_selectedTvShow);

            await _tvShowUserInterface.DisplayRequestSuccessForSeasonAsync(selectedSeason);
        }
Пример #6
0
 public Task DisplayRequestDeniedForSeasonAsync(TvSeason selectedSeason)
 {
     return(Task.CompletedTask);
 }
Пример #7
0
 public Task DisplayNotificationSuccessForSeasonAsync(TvSeason requestedSeason)
 {
     return(Task.CompletedTask);
 }
Пример #8
0
 public Task <bool> AskForSeasonNotificationRequestAsync(TvShow tvShow, TvSeason requestedSeason)
 {
     return(Task.FromResult(false));
 }
Пример #9
0
 public Task WarnSeasonAlreadyAvailableAsync(TvSeason requestedSeason)
 {
     return(Task.CompletedTask);
 }
Пример #10
0
 public Task WarnAlreadySeasonAlreadyRequestedAsync(TvShow tvShow, TvSeason selectedSeason)
 {
     return(Task.CompletedTask);
 }
Пример #11
0
 public Task NotifyForExistingRequestAsync(string userId, TvShow tvShow, TvSeason selectedSeason)
 {
     return(_userInterface.WarnAlreadySeasonAlreadyRequestedAsync(tvShow, selectedSeason));
 }
Пример #12
0
 public Task NotifyForNewRequestAsync(string userId, TvShow tvShow, TvSeason selectedSeason)
 {
     return(Task.CompletedTask);
 }
Пример #13
0
        public async Task NotifyForExistingRequestAsync(string userId, TvShow tvShow, TvSeason selectedSeason)
        {
            if (_notificationsRepository.HasSeasonNotification(userId, tvShow.TheTvDbId, selectedSeason))
            {
                await _userInterface.WarnAlreadyNotifiedForSeasonsAsync(tvShow, selectedSeason);
            }
            else
            {
                var isRequested = await _userInterface.AskForSeasonNotificationRequestAsync(tvShow, selectedSeason);

                if (isRequested)
                {
                    _notificationsRepository.AddSeasonNotification(userId, tvShow.TheTvDbId, selectedSeason);
                    await _userInterface.DisplayNotificationSuccessForSeasonAsync(selectedSeason);
                }
            }
        }