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 } } } } })); }
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); }
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); }