I'm trying to get the certification information for a movie, which I release varies by country. I'm using themoviedbapi on Android
Let's suppose I want to get the info for Interstellar. To save space I have not included all error checking in the below
MovieResultsPage mrp = search.searchMovie("Interstellar", 0, null, false, 0);
List<MovieDb> results_one_page = mrp.getResults(); // I'm only checking the first page of results
// I happen to know that the one I want is first in the list
MovieDb movie = results_one_page.get(0);
// I then pass this MovieDb object to a function to extract the useful info in a String.
// In that function:
...
StringBuffer sb = new StringBuffer();
sb.append("Title: " + movie.getTitle());
sb.append(", released " + movie.getReleaseDate());
sb.append(", id " + movie.getId());
// Iterate over ReleaseInfo's, if any:
List<ReleaseInfo> relinfo = movie.getReleases();
if ( relinfo == null )
{
sb.append(" no release info");
return sb.toString();
}
for ( int i = 0; i < relinfo.size(); i++ )
{
ReleaseInfo ri = relinfo.get(i);
sb.append("\nReleaseInfo[" + i + "]:");
sb.append(" country: " + ri.getCountry());
List<ReleaseDate> dates = ri.getReleaseDates();
if ( dates == null )
{
sb.append("no releaseDate info");
return sb.toString();
}
for ( int j = 0; j < dates.size(); j++ )
{
ReleaseDate rd = dates.get(j);
sb.append("\n\trd[" + j + "]: ");
sb.append("cert " + rd.getCertification());
sb.append(", lang " + rd.getLanguage());
sb.append(", reldate " + rd.getReleaseDate());
sb.append(", note " + rd.getNote());
sb.append(", type " + rd.getType());
}
...
The result I get is:
Title: Interstellar, released 2014-11-05, id 157336, overview The adventures of a group of explorers who make use
of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances
involved in an interstellar voyage., runtime 0, tagline null, status null no release info
Am I calling it wrong? How do I get the certification information, e.g. for the UK? I know there is some, as I can get it using curl:
Hi
I'm trying to get the certification information for a movie, which I release varies by country. I'm using themoviedbapi on Android
Let's suppose I want to get the info for Interstellar. To save space I have not included all error checking in the below
The result I get is:
Am I calling it wrong? How do I get the certification information, e.g. for the UK? I know there is some, as I can get it using
curl
:gives lots of results, including:
Am I doing something wrong, or is the Java code not working properly?
Additionally, queries (including the above) give a run time of 0.
Thanks Matthew