private async Task<bool> LoadExternalIdsForTvShowAsync(TvShow tvShow, int seasonNumber, int episodeNumber)
        {
            var response = await _restConnection.MakeRequestAsync<TmdbExternalIds, object>(Method.Get,
                ResponseType.Json, PlexResources.TmdbBaseUrl,
                string.Format(PlexResources.TmdbTvShowExternalIds, tvShow.Id, seasonNumber, episodeNumber, _apiKey),
                timeout: 30000);

            if (response == null || response.ResponseObject == null)
                return false;

            tvShow.EpisodeExternalIds = response.ResponseObject;

            response = await _restConnection.MakeRequestAsync<TmdbExternalIds, object>(Method.Get,
                ResponseType.Json, PlexResources.TmdbBaseUrl,
                string.Format(PlexResources.TmdbTvShowSeriesExternalIds, tvShow.Id, _apiKey),
                timeout: 30000);

            if (response == null || response.ResponseObject == null)
                return false;

            tvShow.ExternalExternalIds = response.ResponseObject;

            return true;
        }
Beispiel #2
0
 internal static TvShow CloneTvShow(TvShow tvShow)
 {
     return JsonConvert.DeserializeObject<TvShow>(JsonConvert.SerializeObject(tvShow));
 }
        private async Task<bool> LoadCreditsForTvShowAsync(TvShow tvShow, int seasonNumber, int episodeNumber)
        {
            var response = await _restConnection.MakeRequestAsync<Credits, object>(Method.Get,
                ResponseType.Json, PlexResources.TmdbBaseUrl,
                string.Format(PlexResources.TmdbTvShowCredits, tvShow.Id, seasonNumber, episodeNumber, _apiKey),
                timeout: 30000);

            if (response == null || response.ResponseObject == null)
                return false;

            tvShow.Credits = response.ResponseObject;

            PopulateImagePaths(tvShow.Credits);
            return true;
        }
Beispiel #4
0
 internal static TvShow CloneTvShow(TvShow tvShow)
 {
     return(JsonConvert.DeserializeObject <TvShow>(JsonConvert.SerializeObject(tvShow)));
 }