Beispiel #1
0
        private async Task <List <EpisodeDto> > GetEpisodesAsync(TvShowDto tvShow, SeasonDto season)
        {
            await EnsureAccountInitializedAsync();

            var responseObject = await _httpService.GetAsync <GetEpisodesResponse>($"tv/{tvShow.Id}/season/{season.Number}?api_key={_apiKey}");

            return(responseObject.episodes.Select(obj => new EpisodeDto().FromQueryResponse(obj)).OrderBy(obj => obj.Number).Where(obj => obj.Number > 0).ToList());
        }
Beispiel #2
0
        private async Task <List <SeasonDto> > GetSeasonsAsync(TvShowDto tvShow)
        {
            await EnsureAccountInitializedAsync();

            var responseObject = await _httpService.GetAsync <GetSeasonsResponse>($"tv/{tvShow.Id}?api_key={_apiKey}");

            return(responseObject.seasons.Select(obj => new SeasonDto().FromQueryResponse(obj, tvShow.Title)).OrderBy(obj => obj.Number).Where(obj => obj.Number > 0).ToList());
        }