Fix Alt Titles (TV)

master
Stuart Boston 11 years ago
parent ee0c6e12f2
commit 60df7278d4

@ -28,6 +28,7 @@ import com.omertron.themoviedbapi.model.collection.Collection;
import com.omertron.themoviedbapi.model.company.Company; import com.omertron.themoviedbapi.model.company.Company;
import com.omertron.themoviedbapi.model.keyword.Keyword; import com.omertron.themoviedbapi.model.keyword.Keyword;
import com.omertron.themoviedbapi.model.list.UserList; import com.omertron.themoviedbapi.model.list.UserList;
import com.omertron.themoviedbapi.model.movie.AlternativeTitle;
import com.omertron.themoviedbapi.model.movie.MovieBasic; import com.omertron.themoviedbapi.model.movie.MovieBasic;
import com.omertron.themoviedbapi.model.movie.MovieDb; import com.omertron.themoviedbapi.model.movie.MovieDb;
import com.omertron.themoviedbapi.model.person.ContentRating; import com.omertron.themoviedbapi.model.person.ContentRating;
@ -89,6 +90,8 @@ public class AbstractMethod {
}); });
TYPE_REFS.put(TVInfo.class, new TypeReference<WrapperGenericList<TVInfo>>() { TYPE_REFS.put(TVInfo.class, new TypeReference<WrapperGenericList<TVInfo>>() {
}); });
TYPE_REFS.put(AlternativeTitle.class, new TypeReference<WrapperGenericList<AlternativeTitle>>() {
});
} }

@ -42,7 +42,6 @@ import com.omertron.themoviedbapi.tools.Param;
import com.omertron.themoviedbapi.tools.PostBody; import com.omertron.themoviedbapi.tools.PostBody;
import com.omertron.themoviedbapi.tools.PostTools; import com.omertron.themoviedbapi.tools.PostTools;
import com.omertron.themoviedbapi.tools.TmdbParameters; import com.omertron.themoviedbapi.tools.TmdbParameters;
import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperChanges; import com.omertron.themoviedbapi.wrapper.WrapperChanges;
import com.omertron.themoviedbapi.wrapper.WrapperGenericList; import com.omertron.themoviedbapi.wrapper.WrapperGenericList;
import com.omertron.themoviedbapi.wrapper.WrapperImages; import com.omertron.themoviedbapi.wrapper.WrapperImages;
@ -134,15 +133,8 @@ public class TmdbTV extends AbstractMethod {
parameters.add(Param.ID, tvID); parameters.add(Param.ID, tvID);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ALT_TITLES).buildUrl(parameters); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ALT_TITLES).buildUrl(parameters);
String webpage = httpTools.getRequest(url); WrapperGenericList<AlternativeTitle> wrapper = processWrapper(getTypeReference(AlternativeTitle.class), url, "alternative titles");
try { return wrapper.getTmdbResultsList();
WrapperAlternativeTitles wrapper = MAPPER.readValue(webpage, WrapperAlternativeTitles.class);
TmdbResultsList<AlternativeTitle> results = new TmdbResultsList<AlternativeTitle>(wrapper.getTitles());
results.copyWrapper(wrapper);
return results;
} catch (IOException ex) {
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get alternative titles", url, ex);
}
} }
/** /**

@ -118,7 +118,7 @@ Search (Done)
Timezones (Done - part of configuration) Timezones (Done - part of configuration)
/timezones/list Get the list of supported timezones for the API methods that support them. /timezones/list Get the list of supported timezones for the API methods that support them.
TV TV (Done)
/tv/{id} Get the primary information about a TV series by id. /tv/{id} Get the primary information about a TV series by id.
/tv/{id}/account_states This method lets users get the status of whether or not the TV show has been rated or added to their favourite or watch lists. A valid session id is required. /tv/{id}/account_states This method lets users get the status of whether or not the TV show has been rated or added to their favourite or watch lists. A valid session id is required.
/tv/{id}/alternative_titles Get the alternative titles for a specific show ID. /tv/{id}/alternative_titles Get the alternative titles for a specific show ID.

Loading…
Cancel
Save