Example #1
0
 public async Task <PutWatchedResponse> PutSeasonWatchedAsync(SeasonDto season)
 {
     return(await _httpService.PostAsync <PutWatchedResponse>($"sync/history", new PutWatchedBody
     {
         movies = new PutWatchedBody.Movie[0],
         episodes = new PutWatchedBody.Episode[0],
         shows = new PutWatchedBody.Show[1]
         {
             new PutWatchedBody.Show
             {
                 title = season.TvShow.Title,
                 year = season.TvShow.Year.Value,
                 ids = new PutWatchedBody.ShowIds
                 {
                     trakt = season.TvShow.Id,
                 },
                 seasons = new PutWatchedBody.Season[1]
                 {
                     new PutWatchedBody.Season
                     {
                         number = season.Number
                     }
                 }
             }
         }
     }));
 }
Example #2
0
        public static SeasonDto FromQueryResponse(this SeasonDto dto, GetTvShowsWatchedResponse.Season response)
        {
            if (response == null)
            {
                return(dto);
            }

            var seasonDto = new SeasonDto
            {
                Episodes = response.episodes.Select(obj => new EpisodeDto().FromQueryResponse(obj)).ToList(),
                Number   = response.number
            };

            return(seasonDto);
        }
Example #3
0
        public static SeasonDto FromQueryResponse(this SeasonDto dto, GetSeasonsInListResponse.Item response)
        {
            if (response == null)
            {
                return(dto);
            }

            var seasonDto = new SeasonDto
            {
                Number = response.season.number,
                TvShow = new TvShowDto
                {
                    Title = response.show.title
                }
            };

            return(seasonDto);
        }