Updated TV methods

Changed some methods for TVInfo
This commit is contained in:
Stuart Boston
2015-11-08 19:04:15 +00:00
parent c04f330d54
commit 463032bc05
2 changed files with 17 additions and 13 deletions
@@ -390,13 +390,13 @@ public class TmdbTV extends AbstractMethod {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public ResultList<TVBasic> getTVOnTheAir(Integer page, String language) throws MovieDbException {
public ResultList<TVInfo> getTVOnTheAir(Integer page, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.PAGE, page);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ON_THE_AIR).buildUrl(parameters);
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "on the air");
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "on the air");
return wrapper.getResultsList();
}
@@ -411,14 +411,14 @@ public class TmdbTV extends AbstractMethod {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public ResultList<TVBasic> getTVAiringToday(Integer page, String language, String timezone) throws MovieDbException {
public ResultList<TVInfo> getTVAiringToday(Integer page, String language, String timezone) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.PAGE, page);
parameters.add(Param.LANGUAGE, language);
parameters.add(Param.TIMEZONE, timezone);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.AIRING_TODAY).buildUrl(parameters);
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "airing today");
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "airing today");
return wrapper.getResultsList();
}
@@ -435,13 +435,13 @@ public class TmdbTV extends AbstractMethod {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public ResultList<TVBasic> getTVTopRated(Integer page, String language) throws MovieDbException {
public ResultList<TVInfo> getTVTopRated(Integer page, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.PAGE, page);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.TOP_RATED).buildUrl(parameters);
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "top rated TV shows");
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "top rated TV shows");
return wrapper.getResultsList();
}
@@ -453,13 +453,13 @@ public class TmdbTV extends AbstractMethod {
* @return
* @throws com.omertron.themoviedbapi.MovieDbException
*/
public ResultList<TVBasic> getTVPopular(Integer page, String language) throws MovieDbException {
public ResultList<TVInfo> getTVPopular(Integer page, String language) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.PAGE, page);
parameters.add(Param.LANGUAGE, language);
URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.POPULAR).buildUrl(parameters);
WrapperGenericList<TVBasic> wrapper = processWrapper(getTypeReference(TVBasic.class), url, "popular TV shows");
WrapperGenericList<TVInfo> wrapper = processWrapper(getTypeReference(TVInfo.class), url, "popular TV shows");
return wrapper.getResultsList();
}
}
@@ -77,6 +77,7 @@ public class TmdbTVTest extends AbstractTests {
TV_IDS.add(new TestID("The Walking Dead", "tt1520211", 1402, "Andrew Lincoln"));
TV_IDS.add(new TestID("Supernatural", "tt0460681", 1622, "Misha Collins"));
TV_IDS.add(new TestID("The Big Bang Theory", "tt0898266", 1418, "Kaley Cuoco"));
TV_IDS.add(new TestID("Breaking Bad", "tt0903747", 1396, "Aaron Paul"));
}
/**
@@ -233,7 +234,10 @@ public class TmdbTVTest extends AbstractTests {
}
assertTrue(test.getOther() + " not found in cast!", found);
assertFalse(result.getCrew().isEmpty());
// Only breaking bad has crew
if (test.getTmdb() == 1396) {
assertFalse(result.getCrew().isEmpty());
}
break;
}
}
@@ -390,7 +394,7 @@ public class TmdbTVTest extends AbstractTests {
Integer page = null;
String language = LANGUAGE_DEFAULT;
ResultList<TVBasic> result = instance.getTVOnTheAir(page, language);
ResultList<TVInfo> result = instance.getTVOnTheAir(page, language);
TestSuite.test(result, "TV OTA");
}
@@ -406,7 +410,7 @@ public class TmdbTVTest extends AbstractTests {
String language = LANGUAGE_DEFAULT;
String timezone = "";
ResultList<TVBasic> result = instance.getTVAiringToday(page, language, timezone);
ResultList<TVInfo> result = instance.getTVAiringToday(page, language, timezone);
TestSuite.test(result, "TV Airing");
}
@@ -421,7 +425,7 @@ public class TmdbTVTest extends AbstractTests {
Integer page = null;
String language = LANGUAGE_DEFAULT;
ResultList<TVBasic> result = instance.getTVTopRated(page, language);
ResultList<TVInfo> result = instance.getTVTopRated(page, language);
TestSuite.test(result, "TV Top");
}
@@ -436,7 +440,7 @@ public class TmdbTVTest extends AbstractTests {
Integer page = null;
String language = LANGUAGE_DEFAULT;
ResultList<TVBasic> result = instance.getTVPopular(page, language);
ResultList<TVInfo> result = instance.getTVPopular(page, language);
TestSuite.test(result, "tv Popular");
}