示例#1
0
 public async Task <PutWatchedResponse> PutMovieWatchedAsync(MovieDto movie)
 {
     return(await _httpService.PostAsync <PutWatchedResponse>($"sync/history", new PutWatchedBody
     {
         movies = new PutWatchedBody.Movie[1]
         {
             new PutWatchedBody.Movie
             {
                 title = movie.Title,
                 year = movie.Year.Value,
                 ids = new PutWatchedBody.MovieIds
                 {
                     trakt = movie.Id,
                 }
             }
         },
         episodes = new PutWatchedBody.Episode[0],
         shows = new PutWatchedBody.Show[0]
     }));
 }
示例#2
0
        public async Task <List <TranslationDto> > GetMovieTranslationsAsync(MovieDto movie, string language = null)
        {
            var responseObject = await _httpService.GetAsync <GetMovieTranslationsResponse.Item[]>($"movies/{movie.Id}/translations/{language ?? string.Empty}");

            return(responseObject.Select(obj => new TranslationDto().FromQueryResponse(obj)).OrderBy(obj => obj.Title).ToList());
        }