示例#1
0
        private async Task HandleTvShowSelection(SearchedTvShow searchedTvShow)
        {
            var tvShow = await GetTvShow(searchedTvShow);

            if (tvShow.AllSeasonsAlreadyRequested())
            {
                if (tvShow.Seasons.OfType <FutureTvSeasons>().Any())
                {
                    await new FutureSeasonsRequestingWorkflow(_user, _searcher, _requester, _userInterface, _notificationRequestRepository)
                    .HandleRequestAsync(tvShow, tvShow.Seasons.OfType <FutureTvSeasons>().FirstOrDefault());
                }
                else
                {
                    await _userInterface.DisplayTvShowDetailsAsync(tvShow);

                    await _userInterface.WarnShowHasEnded(tvShow);
                }
            }
            else if (!tvShow.IsMultiSeasons() && tvShow.Seasons.OfType <NormalTvSeason>().Any())
            {
                await new NormalTvSeasonRequestingWorkflow(_user, _searcher, _requester, _userInterface, _notificationRequestRepository)
                .HandleRequestAsync(tvShow, tvShow.Seasons.OfType <NormalTvSeason>().Single());
            }
            else
            {
                await RequestTvShowSeason(tvShow);
            }
        }