diff --git a/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java b/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java index 6107f7b42..68a03c426 100644 --- a/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java +++ b/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java @@ -27,8 +27,11 @@ import com.omertron.themoviedbapi.model.keyword.Keyword; import com.omertron.themoviedbapi.model.media.MediaCreditList; import com.omertron.themoviedbapi.model.media.MediaState; import com.omertron.themoviedbapi.model.movie.AlternativeTitle; +import com.omertron.themoviedbapi.model.movie.Translation; +import com.omertron.themoviedbapi.model.movie.Video; import com.omertron.themoviedbapi.model.person.ContentRating; import com.omertron.themoviedbapi.model.person.ExternalID; +import com.omertron.themoviedbapi.model.tv.TVBasic; import com.omertron.themoviedbapi.model.tv.TVInfo; import com.omertron.themoviedbapi.results.TmdbResultsList; import com.omertron.themoviedbapi.tools.ApiUrl; @@ -43,6 +46,8 @@ import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles; import com.omertron.themoviedbapi.wrapper.WrapperChanges; import com.omertron.themoviedbapi.wrapper.WrapperGenericList; import com.omertron.themoviedbapi.wrapper.WrapperImages; +import com.omertron.themoviedbapi.wrapper.WrapperTranslations; +import com.omertron.themoviedbapi.wrapper.WrapperVideos; import java.io.IOException; import java.net.URL; import org.yamj.api.common.exception.ApiExceptionType; @@ -338,12 +343,21 @@ public class TmdbTV extends AbstractMethod { * @return * @throws com.omertron.themoviedbapi.MovieDbException */ - public String getTVTranslations(int tvID) throws MovieDbException { + public TmdbResultsList getTVTranslations(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.TRANSLATIONS).buildUrl(parameters); - return null; + String webpage = httpTools.getRequest(url); + + try { + WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class); + TmdbResultsList results = new TmdbResultsList(wrapper.getTranslations()); + results.copyWrapper(wrapper); + return results; + } catch (IOException ex) { + throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get translations", url, ex); + } } /** @@ -355,13 +369,22 @@ public class TmdbTV extends AbstractMethod { * @return * @throws com.omertron.themoviedbapi.MovieDbException */ - public String getTVVideos(int tvID, String language) throws MovieDbException { + public TmdbResultsList