Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f1c359a9f | |||
| 0c455accb5 | |||
| ca4fc59a80 | |||
| 799d6d6fd5 | |||
| 39465e1ba2 | |||
| c208b62384 | |||
| e83d947dfe | |||
| bab9c80781 | |||
| 45515869c6 | |||
| 11f18ce3d8 | |||
| a9e22f4d75 | |||
| 1d977f9d7b | |||
| 96aa13bd70 | |||
| 84e08a93e2 | |||
| 2dc61738c8 | |||
| b0c998b984 | |||
| f506be70ea | |||
| 42ff59d4ba | |||
| 302e47b496 | |||
| f0499bba01 | |||
| 95a0613cb0 | |||
| eb396be02e | |||
| 80177ff9c7 | |||
| 66de073677 | |||
| cf667fa69e | |||
| 525657e6f6 | |||
| f0faafe702 | |||
| c7b37121ca | |||
| 2c7095908b | |||
| 012d694d78 | |||
| cbc2121a87 | |||
| d1e1454134 | |||
| 80414b7c2a | |||
| 3bfbc1c0a7 | |||
| 463032bc05 | |||
| c04f330d54 | |||
| e95b76c44a | |||
| d8e56616e8 | |||
| a47c55ee7e | |||
| 4134594de5 | |||
| 64ca72c182 | |||
| d21bf07f1d | |||
| b5b84cc962 | |||
| 2837424c09 | |||
| c8310935aa | |||
| 50171a7da5 | |||
| f512fc0754 | |||
| 06da84c2ac | |||
| c3569f0140 | |||
| 4f9d74c9f7 | |||
| 0aab56a044 | |||
| 87f973955e | |||
| 64e88fa9f3 | |||
| fb0e14cd21 | |||
| 8451a4630b | |||
| e00d9357e2 | |||
| 212143b18d | |||
| c9f85bab6d | |||
| 4ec54425f3 | |||
| 00b538efb1 | |||
| b16d452114 | |||
| a83c75070d | |||
| 178b49c413 | |||
| 55601a0698 | |||
| a874297106 | |||
| eff654fd61 | |||
| 63afef71a4 | |||
| 1b180f9e28 | |||
| cfc215cd74 | |||
| 5fefa68352 |
+5
-5
@@ -10,13 +10,13 @@
|
||||
*.dbproj merge=union
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
|
||||
+2
-1
@@ -11,4 +11,5 @@ testing.properties
|
||||
.settings
|
||||
.classpath
|
||||
.project
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
/nbproject/
|
||||
@@ -8,5 +8,6 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface JsonProperty {
|
||||
String value() default "";
|
||||
|
||||
String value() default "";
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface JsonRootName {
|
||||
String value() default "";
|
||||
String value() default "";
|
||||
}
|
||||
|
||||
@@ -11,59 +11,56 @@ import org.json.JSONObject;
|
||||
|
||||
public class ObjectMapper {
|
||||
|
||||
/**
|
||||
* This takes a JSON string and creates (and populates) an object of the given class
|
||||
* with the data from that JSON string. It mimics the method signature of the jackson
|
||||
* JSON API, so that we don't have to import the jackson library into this application.
|
||||
*
|
||||
* @param jsonString The JSON string to parse.
|
||||
* @param objClass The class of object we want to create.
|
||||
* @return The instantiation of that class, populated with data from the JSON object.
|
||||
* @throws IOException If there was any kind of issue.
|
||||
*/
|
||||
public <T> T readValue(String jsonString, Class<T> objClass) throws IOException {
|
||||
try {
|
||||
return readValue(new JSONObject(jsonString), objClass);
|
||||
}
|
||||
catch (IOException ioe) {
|
||||
throw ioe;
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This takes a JSON string and creates (and populates) an object of the
|
||||
* given class with the data from that JSON string. It mimics the method
|
||||
* signature of the jackson JSON API, so that we don't have to import the
|
||||
* jackson library into this application.
|
||||
*
|
||||
* @param jsonString The JSON string to parse.
|
||||
* @param objClass The class of object we want to create.
|
||||
* @return The instantiation of that class, populated with data from the
|
||||
* JSON object.
|
||||
* @throws IOException If there was any kind of issue.
|
||||
*/
|
||||
public <T> T readValue(String jsonString, Class<T> objClass) throws IOException {
|
||||
try {
|
||||
return readValue(new JSONObject(jsonString), objClass);
|
||||
} catch (IOException ioe) {
|
||||
throw ioe;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T, R> T readValue(JSONObject json, Class<T> objClass) throws IOException {
|
||||
try {
|
||||
//TODO Iterate through json object values and call the JsonAnySetter method on the unknown ones.
|
||||
T obj = objClass.newInstance();
|
||||
for (Field f : objClass.getFields()) {
|
||||
Annotation a = f.getAnnotation(JsonProperty.class);
|
||||
if (List.class.equals(f.getType()) && (json.optJSONArray(((JsonProperty) a).value()) != null)) { // It's a list.
|
||||
JSONArray jsonArray = json.optJSONArray(((JsonProperty) a).value());
|
||||
ParameterizedType listType = (ParameterizedType) f.getGenericType();
|
||||
Class<?> subObj = (Class<?>) listType.getActualTypeArguments()[0];
|
||||
List<R> subObjList = ((Class<List<R>>) f.getType()).newInstance();
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
subObjList.add((R) readValue(jsonArray.getJSONObject(i), subObj));
|
||||
}
|
||||
f.set(obj, subObjList);
|
||||
}
|
||||
else if (a != null) {
|
||||
f.set(obj, json.opt(((JsonProperty) a).value()));
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
catch (IOException ioe) {
|
||||
throw ioe;
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T, R> T readValue(JSONObject json, Class<T> objClass) throws IOException {
|
||||
try {
|
||||
//TODO Iterate through json object values and call the JsonAnySetter method on the unknown ones.
|
||||
T obj = objClass.newInstance();
|
||||
for (Field f : objClass.getFields()) {
|
||||
Annotation a = f.getAnnotation(JsonProperty.class);
|
||||
if (List.class.equals(f.getType()) && (json.optJSONArray(((JsonProperty) a).value()) != null)) { // It's a list.
|
||||
JSONArray jsonArray = json.optJSONArray(((JsonProperty) a).value());
|
||||
ParameterizedType listType = (ParameterizedType) f.getGenericType();
|
||||
Class<?> subObj = (Class<?>) listType.getActualTypeArguments()[0];
|
||||
List<R> subObjList = ((Class<List<R>>) f.getType()).newInstance();
|
||||
for (int i = 0; i < jsonArray.length(); i++) {
|
||||
subObjList.add((R) readValue(jsonArray.getJSONObject(i), subObj));
|
||||
}
|
||||
f.set(obj, subObjList);
|
||||
} else if (a != null) {
|
||||
f.set(obj, json.opt(((JsonProperty) a).value()));
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
} catch (IOException ioe) {
|
||||
throw ioe;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,10 @@ Author: Stuart Boston (Omertron AT Gmail DOT com)
|
||||
|
||||
This API uses the [TheMovieDB.org API](http://api.themoviedb.org/)
|
||||
|
||||
Originally written for use by Yet Another Movie Jukebox [(YAMJ)](http://code.google.com/p/moviejukebox/)
|
||||
Originally written for use by YetAnotherMovieJukebox ([YAMJv2](https://github.com/YAMJ/yamj-v2) & [YAMJv3](https://github.com/YAMJ/yamj-v3)), but anyone can feel free to use it for other projects as well.
|
||||
|
||||
But anyone can use it for other projects as well.
|
||||
[](http://jenkins.omertron.com/job/API-TheMovieDb)
|
||||
|
||||
[](https://flattr.com/submit/auto?user_id=Omertron&url=https://github.com/Omertron/api-themoviedb&title=TheMovieDB API&language=&tags=github&category=software)
|
||||
|
||||
[](https://bitdeli.com/free "Bitdeli Badge")
|
||||
***
|
||||
|
||||
TMDB TV Support
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<groupId>com.omertron</groupId>
|
||||
<artifactId>themoviedbapi</artifactId>
|
||||
<version>4.0</version>
|
||||
<version>4.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>API-The MovieDB</name>
|
||||
@@ -71,8 +71,12 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<distribution.format>zip</distribution.format>
|
||||
<version.jackson>2.5.1</version.jackson>
|
||||
<version.slf4j>1.7.10</version.slf4j>
|
||||
<version.jackson>2.7.1</version.jackson>
|
||||
<version.slf4j>1.7.16</version.slf4j>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>yyyy-MM-dd-HHmm</maven.build.timestamp.format>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -115,9 +119,14 @@
|
||||
<dependency>
|
||||
<groupId>org.yamj</groupId>
|
||||
<artifactId>api-common</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<!-- Apache Utils -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
@@ -126,207 +135,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}-${project.version}-${buildNumber}</finalName>
|
||||
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<version>1.3</version>
|
||||
<configuration>
|
||||
<shortRevisionLength>10</shortRevisionLength>
|
||||
<doCheck>false</doCheck>
|
||||
<doUpdate>false</doUpdate>
|
||||
<timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<configuration>
|
||||
<failOnError>true</failOnError>
|
||||
<verbose>true</verbose>
|
||||
<!-- excludes><exclude>**/*</exclude></excludes -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Specification-Title>${project.name}</Specification-Title>
|
||||
<Specification-Version>${project.version}</Specification-Version>
|
||||
<Implementation-Version>${buildNumber}</Implementation-Version>
|
||||
<Implementation-Title>${timestamp}</Implementation-Title>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18</version>
|
||||
<configuration>
|
||||
<!-- To skip tests by default -->
|
||||
<skipTests>${skipTests}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>create-version-txt</id>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<property name="version_file" value="${project.build.directory}/version.txt" />
|
||||
<property name="header_line" value="The MovieDb API${line.separator}" />
|
||||
<property name="build_date_line" value="Build Date: ${timestamp}${line.separator}" />
|
||||
<property name="version_line" value="Version: ${project.version}${line.separator}" />
|
||||
<property name="buildnumber_line" value="Git-SHA: ${buildNumber}${line.separator}" />
|
||||
<echo>Writing version file: ${version_file}</echo>
|
||||
<echo file="${version_file}" append="false">${header_line}</echo>
|
||||
<echo file="${version_file}" append="true">${build_date_line}</echo>
|
||||
<echo file="${version_file}" append="true">${version_line}</echo>
|
||||
<echo file="${version_file}" append="true">${buildnumber_line}</echo>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>distro-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/resources/bin.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.4</version>
|
||||
<configuration>
|
||||
<reportPlugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<reports>
|
||||
<report>index</report>
|
||||
<report>scm</report>
|
||||
<report>issue-tracking</report>
|
||||
<report>help</report>
|
||||
<report>dependency-convergence</report>
|
||||
<report>summary</report>
|
||||
<report>dependency-management</report>
|
||||
<report>dependencies</report>
|
||||
<report>license</report>
|
||||
<report>modules</report>
|
||||
</reports>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
</plugin>
|
||||
</reportPlugins>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>2.6.1</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.5</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</extension>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-manager-plexus</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</extension>
|
||||
<extension>
|
||||
<groupId>org.kathrynhuxtable.maven.wagon</groupId>
|
||||
<artifactId>wagon-gitsite</artifactId>
|
||||
<version>0.3.1</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release-sign-artifacts</id>
|
||||
@@ -355,4 +163,200 @@
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}-${project.version}-${timestamp}-${git.commit.id.abbrev}</finalName>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources/</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>version.txt</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>revision</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
|
||||
<dateFormat>yyyy-MM-dd HH:mm:ss z</dateFormat>
|
||||
<abbrevLength>7</abbrevLength>
|
||||
<injectAllReactorProjects>true</injectAllReactorProjects>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Specification-Title>${project.name}</Specification-Title>
|
||||
<Specification-Version>${project.version}</Specification-Version>
|
||||
<Implementation-Version>${buildNumber}</Implementation-Version>
|
||||
<Implementation-Title>${timestamp}</Implementation-Title>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- To skip tests by default -->
|
||||
<skipTests>${skipTests}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>distro-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/resources/bin.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<failOnError>true</failOnError>
|
||||
<verbose>true</verbose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<configuration>
|
||||
<reportPlugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<reports>
|
||||
<report>index</report>
|
||||
<report>scm</report>
|
||||
<report>issue-tracking</report>
|
||||
<report>help</report>
|
||||
<report>dependency-convergence</report>
|
||||
<report>summary</report>
|
||||
<report>dependency-management</report>
|
||||
<report>dependencies</report>
|
||||
<report>license</report>
|
||||
<report>modules</report>
|
||||
</reports>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
</plugin>
|
||||
</reportPlugins>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<extensions>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</extension>
|
||||
<extension>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-manager-plexus</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</extension>
|
||||
<extension>
|
||||
<groupId>org.kathrynhuxtable.maven.wagon</groupId>
|
||||
<artifactId>wagon-gitsite</artifactId>
|
||||
<version>0.3.1</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,7 +28,7 @@ import com.omertron.themoviedbapi.interfaces.AppendToResponseMethod;
|
||||
*/
|
||||
public class AppendToResponseBuilder {
|
||||
|
||||
private StringBuilder response;
|
||||
private final StringBuilder response;
|
||||
|
||||
/**
|
||||
* Construct the builder with the first method
|
||||
@@ -36,7 +36,7 @@ public class AppendToResponseBuilder {
|
||||
* @param method
|
||||
*/
|
||||
public AppendToResponseBuilder(AppendToResponseMethod method) {
|
||||
response.append(method.getPropertyString());
|
||||
response = new StringBuilder(method.getPropertyString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -60,6 +60,9 @@ import com.omertron.themoviedbapi.model.collection.CollectionInfo;
|
||||
import com.omertron.themoviedbapi.model.company.Company;
|
||||
import com.omertron.themoviedbapi.model.config.Configuration;
|
||||
import com.omertron.themoviedbapi.model.config.JobDepartment;
|
||||
import com.omertron.themoviedbapi.model.credits.CreditBasic;
|
||||
import com.omertron.themoviedbapi.model.credits.CreditMovieBasic;
|
||||
import com.omertron.themoviedbapi.model.credits.CreditTVBasic;
|
||||
import com.omertron.themoviedbapi.model.discover.Discover;
|
||||
import com.omertron.themoviedbapi.model.keyword.Keyword;
|
||||
import com.omertron.themoviedbapi.model.list.ListItem;
|
||||
@@ -1162,7 +1165,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public PersonCreditList getPersonMovieCredits(int personId, String language) throws MovieDbException {
|
||||
public PersonCreditList<CreditMovieBasic> getPersonMovieCredits(int personId, String language) throws MovieDbException {
|
||||
return tmdbPeople.getPersonMovieCredits(personId, language);
|
||||
}
|
||||
|
||||
@@ -1180,7 +1183,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public PersonCreditList getPersonTVCredits(int personId, String language) throws MovieDbException {
|
||||
public PersonCreditList<CreditTVBasic> getPersonTVCredits(int personId, String language) throws MovieDbException {
|
||||
return tmdbPeople.getPersonTVCredits(personId, language);
|
||||
}
|
||||
|
||||
@@ -1198,7 +1201,7 @@ public class TheMovieDbApi {
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public PersonCreditList getPersonCombinedCredits(int personId, String language) throws MovieDbException {
|
||||
public PersonCreditList<CreditBasic> getPersonCombinedCredits(int personId, String language) throws MovieDbException {
|
||||
return tmdbPeople.getPersonCombinedCredits(personId, language);
|
||||
}
|
||||
|
||||
@@ -1619,7 +1622,7 @@ public class TheMovieDbApi {
|
||||
* @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 {
|
||||
return tmdbTv.getTVOnTheAir(page, language);
|
||||
}
|
||||
|
||||
@@ -1634,7 +1637,7 @@ public class TheMovieDbApi {
|
||||
* @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 {
|
||||
return tmdbTv.getTVAiringToday(page, language, timezone);
|
||||
}
|
||||
|
||||
@@ -1651,7 +1654,7 @@ public class TheMovieDbApi {
|
||||
* @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 {
|
||||
return tmdbTv.getTVTopRated(page, language);
|
||||
}
|
||||
|
||||
@@ -1663,7 +1666,7 @@ public class TheMovieDbApi {
|
||||
* @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 {
|
||||
return tmdbTv.getTVPopular(page, language);
|
||||
}
|
||||
//</editor-fold>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.omertron.themoviedbapi.enumeration;
|
||||
|
||||
public enum Gender {
|
||||
MALE(1),
|
||||
FEMALE(2),
|
||||
UNKNOWN(0);
|
||||
|
||||
private final int type;
|
||||
|
||||
private Gender(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the gender from an integer type
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static Gender fromInteger(int type) {
|
||||
for (Gender gender : Gender.values()) {
|
||||
if (gender.type == type) {
|
||||
return gender;
|
||||
}
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.omertron.themoviedbapi.enumeration;
|
||||
|
||||
/**
|
||||
* Release Type for the video
|
||||
*
|
||||
* @author stuar
|
||||
*/
|
||||
public enum ReleaseType {
|
||||
PREMIERE(1),
|
||||
THEATRICAL_LIMITED(2),
|
||||
THEATRICAL(3),
|
||||
DIGITAL(4),
|
||||
PHYSICAL(5),
|
||||
TV(6),
|
||||
UNKNOWN(0);
|
||||
|
||||
private final int type;
|
||||
|
||||
private ReleaseType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Release Type from an integer type
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static ReleaseType fromInteger(int type) {
|
||||
for (ReleaseType rt : ReleaseType.values()) {
|
||||
if (rt.type == type) {
|
||||
return rt;
|
||||
}
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.list.UserList;
|
||||
import com.omertron.themoviedbapi.model.media.AlternativeTitle;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieBasic;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||
import com.omertron.themoviedbapi.model.person.ContentRating;
|
||||
import com.omertron.themoviedbapi.model.person.PersonInfo;
|
||||
import com.omertron.themoviedbapi.model.person.PersonFind;
|
||||
@@ -67,7 +68,7 @@ public class AbstractMethod {
|
||||
protected final HttpTools httpTools;
|
||||
// Jackson JSON configuration
|
||||
protected static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
private static final Map<Class, TypeReference> TYPE_REFS = new HashMap<Class, TypeReference>();
|
||||
private static final Map<Class, TypeReference> TYPE_REFS = new HashMap<>();
|
||||
|
||||
static {
|
||||
TYPE_REFS.put(MovieBasic.class, new TypeReference<WrapperGenericList<MovieBasic>>() {
|
||||
@@ -100,6 +101,8 @@ public class AbstractMethod {
|
||||
});
|
||||
TYPE_REFS.put(AlternativeTitle.class, new TypeReference<WrapperGenericList<AlternativeTitle>>() {
|
||||
});
|
||||
TYPE_REFS.put(ReleaseDates.class, new TypeReference<WrapperGenericList<ReleaseDates>>() {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -186,7 +189,7 @@ public class AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperChanges wrapper = MAPPER.readValue(webpage, WrapperChanges.class);
|
||||
ResultList<ChangeKeyItem> results = new ResultList<ChangeKeyItem>(wrapper.getChangedItems());
|
||||
ResultList<ChangeKeyItem> results = new ResultList<>(wrapper.getChangedItems());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -50,13 +50,16 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to generate a valid request token for user based authentication.
|
||||
* This method is used to generate a valid request token for user based
|
||||
* authentication.
|
||||
*
|
||||
* A request token is required in order to request a session id.
|
||||
*
|
||||
* You can generate any number of request tokens but they will expire after 60 minutes.
|
||||
* You can generate any number of request tokens but they will expire after
|
||||
* 60 minutes.
|
||||
*
|
||||
* As soon as a valid session id has been created the token will be destroyed.
|
||||
* As soon as a valid session id has been created the token will be
|
||||
* destroyed.
|
||||
*
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
@@ -75,7 +78,8 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to generate a session id for user based authentication.
|
||||
* This method is used to generate a session id for user based
|
||||
* authentication.
|
||||
*
|
||||
* A session id is required in order to use any of the write methods.
|
||||
*
|
||||
@@ -102,7 +106,8 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to generate a session id for user based authentication. User must provide their username and password
|
||||
* This method is used to generate a session id for user based
|
||||
* authentication. User must provide their username and password
|
||||
*
|
||||
* A session id is required in order to use any of the write methods.
|
||||
*
|
||||
@@ -136,14 +141,18 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
/**
|
||||
* This method is used to generate a guest session id.
|
||||
*
|
||||
* A guest session can be used to rate movies without having a registered TMDb user account.
|
||||
* A guest session can be used to rate movies without having a registered
|
||||
* TMDb user account.
|
||||
*
|
||||
* You should only generate a single guest session per user (or device) as you will be able to attach the ratings to a TMDb user
|
||||
* account in the future.
|
||||
* You should only generate a single guest session per user (or device) as
|
||||
* you will be able to attach the ratings to a TMDb user account in the
|
||||
* future.
|
||||
*
|
||||
* There are also IP limits in place so you should always make sure it's the end user doing the guest session actions.
|
||||
* There are also IP limits in place so you should always make sure it's the
|
||||
* end user doing the guest session actions.
|
||||
*
|
||||
* If a guest session is not used for the first time within 24 hours, it will be automatically discarded.
|
||||
* If a guest session is not used for the first time within 24 hours, it
|
||||
* will be automatically discarded.
|
||||
*
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
@@ -157,4 +166,5 @@ public class TmdbAuthentication extends AbstractMethod {
|
||||
} catch (IOException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get Guest Session Token", url, ex);
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -65,7 +65,7 @@ public class TmdbCertifications extends AbstractMethod {
|
||||
JsonNode node = MAPPER.readTree(webpage);
|
||||
Map<String, List<Certification>> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference<Map<String, List<Certification>>>() {
|
||||
});
|
||||
return new ResultsMap<String, List<Certification>>(results);
|
||||
return new ResultsMap<>(results);
|
||||
} catch (IOException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get movie certifications", url, ex);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class TmdbCertifications extends AbstractMethod {
|
||||
JsonNode node = MAPPER.readTree(webpage);
|
||||
Map<String, List<Certification>> results = MAPPER.readValue(node.elements().next().traverse(), new TypeReference<Map<String, List<Certification>>>() {
|
||||
});
|
||||
return new ResultsMap<String, List<Certification>>(results);
|
||||
return new ResultsMap<>(results);
|
||||
} catch (IOException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV certifications", url, ex);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -97,7 +97,7 @@ public class TmdbCollections extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll(ArtworkType.POSTER, ArtworkType.BACKDROP));
|
||||
ResultList<Artwork> results = new ResultList<>(wrapper.getAll(ArtworkType.POSTER, ArtworkType.BACKDROP));
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -95,7 +95,7 @@ public class TmdbConfiguration extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperJobList wrapper = MAPPER.readValue(webpage, WrapperJobList.class);
|
||||
ResultList<JobDepartment> results = new ResultList<JobDepartment>(wrapper.getJobs());
|
||||
ResultList<JobDepartment> results = new ResultList<>(wrapper.getJobs());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -121,7 +121,7 @@ public class TmdbConfiguration extends AbstractMethod {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get timezone list", url, ex);
|
||||
}
|
||||
|
||||
ResultsMap<String, List<String>> timezones = new ResultsMap<String, List<String>>();
|
||||
ResultsMap<String, List<String>> timezones = new ResultsMap<>();
|
||||
|
||||
for (Map<String, List<String>> tzMap : tzList) {
|
||||
for (Map.Entry<String, List<String>> x : tzMap.entrySet()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,7 +28,6 @@ import com.omertron.themoviedbapi.tools.Param;
|
||||
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.yamj.api.common.exception.ApiExceptionType;
|
||||
|
||||
/**
|
||||
@@ -78,7 +77,6 @@ public class TmdbCredits extends AbstractMethod {
|
||||
try {
|
||||
return MAPPER.readValue(webpage, CreditInfo.class);
|
||||
} catch (IOException ex) {
|
||||
LoggerFactory.getLogger("test").info("{}",ex);
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get credit info", url, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -42,7 +42,6 @@ import com.omertron.themoviedbapi.results.WrapperImages;
|
||||
import com.omertron.themoviedbapi.results.WrapperVideos;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.yamj.api.common.exception.ApiExceptionType;
|
||||
|
||||
/**
|
||||
@@ -65,7 +64,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the primary information about a TV episode by combination of a season and episode number.
|
||||
* Get the primary information about a TV episode by combination of a season
|
||||
* and episode number.
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -89,7 +89,6 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
try {
|
||||
return MAPPER.readValue(webpage, TVEpisodeInfo.class);
|
||||
} catch (IOException ex) {
|
||||
LoggerFactory.getLogger("test").warn("{}", ex);
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get TV Episode Info", url, ex);
|
||||
}
|
||||
}
|
||||
@@ -108,7 +107,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method lets users get the status of whether or not the TV episode has been rated.
|
||||
* This method lets users get the status of whether or not the TV episode
|
||||
* has been rated.
|
||||
*
|
||||
* A valid session id is required.
|
||||
*
|
||||
@@ -161,7 +161,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the external ids for a TV episode by comabination of a season and episode number.
|
||||
* Get the external ids for a TV episode by comabination of a season and
|
||||
* episode number.
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -188,7 +189,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the images (episode stills) for a TV episode by combination of a season and episode number.
|
||||
* Get the images (episode stills) for a TV episode by combination of a
|
||||
* season and episode number.
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -207,7 +209,7 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
||||
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -216,7 +218,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method lets users rate a TV episode. A valid session id or guest session id is required.
|
||||
* This method lets users rate a TV episode. A valid session id or guest
|
||||
* session id is required.
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -253,7 +256,8 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the videos that have been added to a TV episode (teasers, clips, etc...)
|
||||
* Get the videos that have been added to a TV episode (teasers, clips,
|
||||
* etc...)
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -274,7 +278,7 @@ public class TmdbEpisodes extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
||||
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -91,7 +91,7 @@ public class TmdbGenres extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperGenres wrapper = MAPPER.readValue(webpage, WrapperGenres.class);
|
||||
ResultList<Genre> results = new ResultList<Genre>(wrapper.getGenres());
|
||||
ResultList<Genre> results = new ResultList<>(wrapper.getGenres());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,6 +32,7 @@ import com.omertron.themoviedbapi.model.media.MediaState;
|
||||
import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.Video;
|
||||
import com.omertron.themoviedbapi.model.movie.MovieInfo;
|
||||
import com.omertron.themoviedbapi.model.movie.ReleaseDates;
|
||||
import com.omertron.themoviedbapi.model.movie.ReleaseInfo;
|
||||
import com.omertron.themoviedbapi.model.review.Review;
|
||||
import com.omertron.themoviedbapi.results.ResultList;
|
||||
@@ -78,8 +79,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
*
|
||||
* It will return the single highest rated poster and backdrop.
|
||||
*
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
||||
* found.
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||
*
|
||||
* @param movieId
|
||||
* @param language
|
||||
@@ -111,8 +111,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
*
|
||||
* It will return the single highest rated poster and backdrop.
|
||||
*
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies
|
||||
* found.
|
||||
* ApiExceptionType.MOVIE_ID_NOT_FOUND will be thrown if there are no movies found.
|
||||
*
|
||||
* @param imdbId
|
||||
* @param language
|
||||
@@ -141,8 +140,8 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method lets a user get the status of whether or not the movie has
|
||||
* been rated or added to their favourite or movie watch list.
|
||||
* This method lets a user get the status of whether or not the movie has been rated or added to their favourite or movie watch
|
||||
* list.
|
||||
*
|
||||
* A valid session id is required.
|
||||
*
|
||||
@@ -167,8 +166,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the alternative titles we have for
|
||||
* a particular movie.
|
||||
* This method is used to retrieve all of the alternative titles we have for a particular movie.
|
||||
*
|
||||
* @param movieId
|
||||
* @param country
|
||||
@@ -184,7 +182,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
String webpage = httpTools.getRequest(url);
|
||||
try {
|
||||
WrapperAlternativeTitles wrapper = MAPPER.readValue(webpage, WrapperAlternativeTitles.class);
|
||||
ResultList<AlternativeTitle> results = new ResultList<AlternativeTitle>(wrapper.getTitles());
|
||||
ResultList<AlternativeTitle> results = new ResultList<>(wrapper.getTitles());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -213,8 +211,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method should be used when you’re wanting to retrieve all of the
|
||||
* images for a particular movie.
|
||||
* This method should be used when you’re wanting to retrieve all of the images for a particular movie.
|
||||
*
|
||||
* @param movieId
|
||||
* @param language
|
||||
@@ -231,7 +228,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
||||
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -240,8 +237,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the keywords that have been added
|
||||
* to a particular movie.
|
||||
* This method is used to retrieve all of the keywords that have been added to a particular movie.
|
||||
*
|
||||
* Currently, only English keywords exist.
|
||||
*
|
||||
@@ -258,7 +254,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperMovieKeywords wrapper = MAPPER.readValue(webpage, WrapperMovieKeywords.class);
|
||||
ResultList<Keyword> results = new ResultList<Keyword>(wrapper.getKeywords());
|
||||
ResultList<Keyword> results = new ResultList<>(wrapper.getKeywords());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -267,8 +263,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the release and certification data
|
||||
* we have for a specific movie.
|
||||
* This method is used to retrieve all of the release and certification data we have for a specific movie.
|
||||
*
|
||||
* @param movieId
|
||||
* @param language
|
||||
@@ -285,7 +280,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperReleaseInfo wrapper = MAPPER.readValue(webpage, WrapperReleaseInfo.class);
|
||||
ResultList<ReleaseInfo> results = new ResultList<ReleaseInfo>(wrapper.getCountries());
|
||||
ResultList<ReleaseInfo> results = new ResultList<>(wrapper.getCountries());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -294,8 +289,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve all of the trailers for a particular
|
||||
* movie.
|
||||
* This method is used to retrieve all of the trailers for a particular movie.
|
||||
*
|
||||
* Supported sites are YouTube and QuickTime.
|
||||
*
|
||||
@@ -314,7 +308,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
||||
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -323,8 +317,25 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve a list of the available translations for
|
||||
* a specific movie.
|
||||
* Get the release dates, certifications and related information by country for a specific movie id.
|
||||
*
|
||||
* The results are keyed by country code and contain a type value.
|
||||
*
|
||||
* @param movieId
|
||||
* @return
|
||||
* @throws MovieDbException
|
||||
*/
|
||||
public ResultList<ReleaseDates> getReleaseDates(int movieId) throws MovieDbException {
|
||||
TmdbParameters parameters = new TmdbParameters();
|
||||
parameters.add(Param.ID, movieId);
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.MOVIE).subMethod(MethodSub.RELEASE_DATES).buildUrl(parameters);
|
||||
WrapperGenericList<ReleaseDates> wrapper = processWrapper(getTypeReference(ReleaseDates.class), url, "release dates");
|
||||
return wrapper.getResultsList();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve a list of the available translations for a specific movie.
|
||||
*
|
||||
* @param movieId
|
||||
* @return
|
||||
@@ -339,7 +350,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
|
||||
ResultList<Translation> results = new ResultList<Translation>(wrapper.getTranslations());
|
||||
ResultList<Translation> results = new ResultList<>(wrapper.getTranslations());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -348,11 +359,9 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* The similar movies method will let you retrieve the similar movies for a
|
||||
* particular movie.
|
||||
* The similar movies method will let you retrieve the similar movies for a particular movie.
|
||||
*
|
||||
* This data is created dynamically but with the help of users votes on
|
||||
* TMDb.
|
||||
* This data is created dynamically but with the help of users votes on TMDb.
|
||||
*
|
||||
* The data is much better with movies that have more keywords
|
||||
*
|
||||
@@ -420,8 +429,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
*
|
||||
* By default, only the last 24 hours of changes are returned.
|
||||
*
|
||||
* The maximum number of days that can be returned in a single request is
|
||||
* 14.
|
||||
* The maximum number of days that can be returned in a single request is 14.
|
||||
*
|
||||
* The language is present on fields that are translatable.
|
||||
*
|
||||
@@ -513,8 +521,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
/**
|
||||
* This method is used to retrieve the movies currently in theatres.
|
||||
*
|
||||
* This is a curated list that will normally contain 100 movies. The default
|
||||
* response will return 20 movies.
|
||||
* This is a curated list that will normally contain 100 movies. The default response will return 20 movies.
|
||||
*
|
||||
* @param language
|
||||
* @param page
|
||||
@@ -552,8 +559,7 @@ public class TmdbMovies extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to retrieve the top rated movies that have over 10
|
||||
* votes on TMDb.
|
||||
* This method is used to retrieve the top rated movies that have over 10 votes on TMDb.
|
||||
*
|
||||
* The default response will return 20 movies.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -46,7 +46,7 @@ import com.omertron.themoviedbapi.tools.Param;
|
||||
import com.omertron.themoviedbapi.tools.TmdbParameters;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.yamj.api.common.exception.ApiExceptionType;
|
||||
|
||||
/**
|
||||
@@ -79,13 +79,19 @@ public class TmdbPeople extends AbstractMethod {
|
||||
parameters.add(Param.ID, personId);
|
||||
parameters.add(Param.APPEND, appendToResponse);
|
||||
|
||||
// Switch combined credits for tv & movie.
|
||||
String atr = (String) parameters.get(Param.APPEND);
|
||||
if (StringUtils.isNotBlank(atr) && atr.contains("combined_credits")) {
|
||||
atr = atr.replace("combined_credits", "tv_credits,movie_credits");
|
||||
parameters.add(Param.APPEND, atr);
|
||||
}
|
||||
|
||||
URL url = new ApiUrl(apiKey, MethodBase.PERSON).buildUrl(parameters);
|
||||
String webpage = httpTools.getRequest(url);
|
||||
|
||||
try {
|
||||
return MAPPER.readValue(webpage, PersonInfo.class);
|
||||
} catch (IOException ex) {
|
||||
LoggerFactory.getLogger("test").info("{}", ex);
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get person info", url, ex);
|
||||
}
|
||||
}
|
||||
@@ -216,7 +222,7 @@ public class TmdbPeople extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll(ArtworkType.PROFILE));
|
||||
ResultList<Artwork> results = new ResultList<>(wrapper.getAll(ArtworkType.PROFILE));
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -203,13 +203,14 @@ public class TmdbSearch extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperMultiSearch wrapper = MAPPER.readValue(webpage, WrapperMultiSearch.class);
|
||||
ResultList<MediaBasic> results = new ResultList<MediaBasic>();
|
||||
ResultList<MediaBasic> results = new ResultList<>();
|
||||
results.getResults().addAll(wrapper.getResults());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "Failed to get multi search", url, ex);
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a good starting point to start finding people on TMDb.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -99,8 +99,7 @@ public class TmdbSeasons extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method lets users get the status of whether or not the TV episodes
|
||||
* of a season have been rated.
|
||||
* This method lets users get the status of whether or not the TV episodes of a season have been rated.
|
||||
*
|
||||
* A valid session id is required.
|
||||
*
|
||||
@@ -147,8 +146,7 @@ public class TmdbSeasons extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the external ids that we have stored for a TV season by season
|
||||
* number.
|
||||
* Get the external ids that we have stored for a TV season by season number.
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -194,7 +192,7 @@ public class TmdbSeasons extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
||||
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -203,8 +201,7 @@ public class TmdbSeasons extends AbstractMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the videos that have been added to a TV season (trailers, teasers,
|
||||
* etc...)
|
||||
* Get the videos that have been added to a TV season (trailers, teasers, etc...)
|
||||
*
|
||||
* @param tvID
|
||||
* @param seasonNumber
|
||||
@@ -223,7 +220,7 @@ public class TmdbSeasons extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
||||
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,7 +32,6 @@ import com.omertron.themoviedbapi.model.media.Translation;
|
||||
import com.omertron.themoviedbapi.model.media.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.ResultList;
|
||||
import com.omertron.themoviedbapi.results.WrapperGenericList;
|
||||
@@ -231,7 +230,7 @@ public class TmdbTV extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperImages wrapper = MAPPER.readValue(webpage, WrapperImages.class);
|
||||
ResultList<Artwork> results = new ResultList<Artwork>(wrapper.getAll());
|
||||
ResultList<Artwork> results = new ResultList<>(wrapper.getAll());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -327,7 +326,7 @@ public class TmdbTV extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperTranslations wrapper = MAPPER.readValue(webpage, WrapperTranslations.class);
|
||||
ResultList<Translation> results = new ResultList<Translation>(wrapper.getTranslations());
|
||||
ResultList<Translation> results = new ResultList<>(wrapper.getTranslations());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -354,7 +353,7 @@ public class TmdbTV extends AbstractMethod {
|
||||
|
||||
try {
|
||||
WrapperVideos wrapper = MAPPER.readValue(webpage, WrapperVideos.class);
|
||||
ResultList<Video> results = new ResultList<Video>(wrapper.getVideos());
|
||||
ResultList<Video> results = new ResultList<>(wrapper.getVideos());
|
||||
wrapper.setResultProperties(results);
|
||||
return results;
|
||||
} catch (IOException ex) {
|
||||
@@ -390,13 +389,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 +410,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 +434,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 +452,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -31,7 +31,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*/
|
||||
public class AbstractIdName extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
|
||||
*/
|
||||
public abstract class AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractJsonMapping.class);
|
||||
|
||||
/**
|
||||
@@ -45,8 +45,8 @@ public abstract class AbstractJsonMapping implements Serializable {
|
||||
@JsonAnySetter
|
||||
protected void handleUnknown(String key, Object value) {
|
||||
StringBuilder unknown = new StringBuilder(this.getClass().getSimpleName());
|
||||
unknown.append(": Unknown property='").append(key);
|
||||
unknown.append("' value='").append(value).append("'");
|
||||
unknown.append(": Unknown property='").append(key)
|
||||
.append("' value='").append(value).append("'");
|
||||
|
||||
LOG.trace(unknown.toString());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -26,7 +26,7 @@ import java.io.Serializable;
|
||||
@JsonRootName("certification")
|
||||
public class Certification extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Properties
|
||||
@JsonProperty("certification")
|
||||
private String value;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class FindResults extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("movie_results")
|
||||
private List<MovieBasic> movieResults;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,6 +28,6 @@ import java.io.Serializable;
|
||||
@JsonRootName("genre")
|
||||
public class Genre extends AbstractIdName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Nothing to override from the base class.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -31,23 +31,23 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
@JsonRootName("spoken_language")
|
||||
public class Language extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("iso_639_1")
|
||||
private String isoCode;
|
||||
private String code;
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
public String getIsoCode() {
|
||||
return isoCode;
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setIsoCode(String isoCode) {
|
||||
this.isoCode = isoCode;
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
@@ -59,7 +59,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
||||
if (obj instanceof Language) {
|
||||
final Language other = (Language) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(isoCode, other.isoCode)
|
||||
.append(code, other.code)
|
||||
.append(name, other.name)
|
||||
.isEquals();
|
||||
} else {
|
||||
@@ -70,7 +70,7 @@ public class Language extends AbstractJsonMapping implements Serializable {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(isoCode)
|
||||
.append(code)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
*/
|
||||
public class StatusCode extends AbstractJsonMapping {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("status_code")
|
||||
private int code;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -22,11 +22,10 @@ package com.omertron.themoviedbapi.model.account;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Account extends AbstractJsonMapping implements Serializable, Identification {
|
||||
public class Account extends AbstractJsonMapping implements Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
@@ -40,6 +39,8 @@ public class Account extends AbstractJsonMapping implements Serializable, Identi
|
||||
private String language;
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
@JsonProperty("avatar")
|
||||
private Avatar avatar;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
@@ -90,4 +91,12 @@ public class Account extends AbstractJsonMapping implements Serializable, Identi
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
public Avatar getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(Avatar avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation;private either version 3 of the License;private or
|
||||
* any later version.
|
||||
*
|
||||
* TheMovieDB API is distributed in the hope that it will be useful;private
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with TheMovieDB API. If not;private see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
public class Avatar extends AbstractJsonMapping {
|
||||
|
||||
@JsonProperty("gravatar")
|
||||
private AvatarHash hash = null;
|
||||
|
||||
public String getHash() {
|
||||
return hash == null ? "" : hash.getHash();
|
||||
}
|
||||
|
||||
public void setHash(AvatarHash hash) {
|
||||
this.hash = hash;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation;private either version 3 of the License;private or
|
||||
* any later version.
|
||||
*
|
||||
* TheMovieDB API is distributed in the hope that it will be useful;private
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with TheMovieDB API. If not;private see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model.account;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
public class AvatarHash extends AbstractJsonMapping {
|
||||
|
||||
@JsonProperty("hash")
|
||||
private String hash;
|
||||
|
||||
public String getHash() {
|
||||
return hash;
|
||||
}
|
||||
|
||||
public void setHash(String hash) {
|
||||
this.hash = hash;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -34,7 +34,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*/
|
||||
public class Artwork extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -38,7 +38,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*/
|
||||
public class ArtworkMedia extends Artwork implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
private MediaType mediaType;
|
||||
@JsonTypeInfo(
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||
|
||||
public class TokenAuthorisation extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
@JsonProperty("expires_at")
|
||||
private String expires;
|
||||
@JsonProperty("request_token")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||
|
||||
public class TokenSession extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
@JsonProperty("session_id")
|
||||
private String sessionId;
|
||||
@JsonProperty("success")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -27,11 +27,11 @@ import java.util.List;
|
||||
|
||||
public class ChangeKeyItem extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
@JsonProperty("items")
|
||||
private List<ChangedItem> changedItems = new ArrayList<ChangedItem>();
|
||||
private List<ChangedItem> changedItems = new ArrayList<>();
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||
|
||||
public class ChangeListItem extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||
|
||||
public class ChangedItem extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@JsonProperty("action")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
import com.omertron.themoviedbapi.interfaces.Identification;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
@@ -34,7 +35,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
@JsonRootName("collection")
|
||||
public class Collection extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
@@ -48,6 +49,24 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
||||
private String backdropPath;
|
||||
@JsonProperty("release_date")
|
||||
private String releaseDate;
|
||||
@JsonProperty("genre_ids")
|
||||
private List<Integer> genreIds;
|
||||
@JsonProperty("adult")
|
||||
private boolean adult;
|
||||
@JsonProperty("original_language")
|
||||
private String originalLanguage;
|
||||
@JsonProperty("original_title")
|
||||
private String originalTitle;
|
||||
@JsonProperty("overview")
|
||||
private String overview;
|
||||
@JsonProperty("video")
|
||||
private boolean video;
|
||||
@JsonProperty("popularity")
|
||||
private float popularity;
|
||||
@JsonProperty("vote_average")
|
||||
private float voteAverage;
|
||||
@JsonProperty("vote_count")
|
||||
private int voteCount;
|
||||
|
||||
public String getBackdropPath() {
|
||||
return backdropPath;
|
||||
@@ -80,6 +99,18 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Integer> getGenreIds() {
|
||||
return genreIds;
|
||||
}
|
||||
|
||||
public boolean isAdult() {
|
||||
return adult;
|
||||
}
|
||||
|
||||
public String getOriginalLanguage() {
|
||||
return originalLanguage;
|
||||
}
|
||||
|
||||
public void setBackdropPath(String backdropPath) {
|
||||
this.backdropPath = backdropPath;
|
||||
}
|
||||
@@ -105,6 +136,66 @@ public class Collection extends AbstractJsonMapping implements Serializable, Ide
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setGenreIds(List<Integer> genreIds) {
|
||||
this.genreIds = genreIds;
|
||||
}
|
||||
|
||||
public void setAdult(boolean adult) {
|
||||
this.adult = adult;
|
||||
}
|
||||
|
||||
public void setOriginalLanguage(String originalLanguage) {
|
||||
this.originalLanguage = originalLanguage;
|
||||
}
|
||||
|
||||
public String getOriginalTitle() {
|
||||
return originalTitle;
|
||||
}
|
||||
|
||||
public void setOriginalTitle(String originalTitle) {
|
||||
this.originalTitle = originalTitle;
|
||||
}
|
||||
|
||||
public String getOverview() {
|
||||
return overview;
|
||||
}
|
||||
|
||||
public void setOverview(String overview) {
|
||||
this.overview = overview;
|
||||
}
|
||||
|
||||
public boolean isVideo() {
|
||||
return video;
|
||||
}
|
||||
|
||||
public void setVideo(boolean video) {
|
||||
this.video = video;
|
||||
}
|
||||
|
||||
public float getPopularity() {
|
||||
return popularity;
|
||||
}
|
||||
|
||||
public void setPopularity(float popularity) {
|
||||
this.popularity = popularity;
|
||||
}
|
||||
|
||||
public float getVoteAverage() {
|
||||
return voteAverage;
|
||||
}
|
||||
|
||||
public void setVoteAverage(float voteAverage) {
|
||||
this.voteAverage = voteAverage;
|
||||
}
|
||||
|
||||
public int getVoteCount() {
|
||||
return voteCount;
|
||||
}
|
||||
|
||||
public void setVoteCount(int voteCount) {
|
||||
this.voteCount = voteCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Collection) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
public class CollectionInfo extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
@@ -45,7 +45,7 @@ public class CollectionInfo extends AbstractJsonMapping implements Serializable,
|
||||
@JsonProperty("backdrop_path")
|
||||
private String backdropPath;
|
||||
@JsonProperty("parts")
|
||||
private List<Collection> parts = new ArrayList<Collection>();
|
||||
private List<Collection> parts = new ArrayList<>();
|
||||
|
||||
public String getBackdropPath() {
|
||||
return backdropPath;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,7 +32,7 @@ import static org.apache.commons.lang3.StringUtils.EMPTY;
|
||||
*/
|
||||
public class Company extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Properties
|
||||
@JsonProperty("id")
|
||||
private int id = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -34,7 +34,7 @@ import org.yamj.api.common.exception.ApiExceptionType;
|
||||
*/
|
||||
public class Configuration extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("base_url")
|
||||
private String baseUrl;
|
||||
@@ -199,8 +199,7 @@ public class Configuration extends AbstractJsonMapping implements Serializable {
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(getBaseUrl());
|
||||
sb.append(requiredSize);
|
||||
sb.append(imagePath);
|
||||
sb.append(requiredSize).append(imagePath);
|
||||
|
||||
try {
|
||||
return new URL(sb.toString());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -26,7 +26,7 @@ import java.util.List;
|
||||
|
||||
public class JobDepartment extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Properties
|
||||
@JsonProperty("department")
|
||||
private String department;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class CreditBasic extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
private CreditType creditType;
|
||||
private MediaType mediaType;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class CreditMovieBasic extends CreditBasic implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("adult")
|
||||
private boolean adult;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class CreditTVBasic extends CreditBasic implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("episode_count")
|
||||
private int episodeCount;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -30,7 +30,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MediaCredit extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("credit_id")
|
||||
private String creditId;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MediaCreditCast extends MediaCredit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("cast_id")
|
||||
private int castId = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MediaCreditCrew extends MediaCredit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("department")
|
||||
private String department;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -25,7 +25,7 @@ import com.omertron.themoviedbapi.tools.TmdbParameters;
|
||||
|
||||
/**
|
||||
* Generate a discover object for use in the MovieDbApi
|
||||
* <p/>
|
||||
* <p>
|
||||
* This allows you to just add the search components you are concerned with
|
||||
*
|
||||
* @author stuart.boston
|
||||
@@ -39,7 +39,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Get the parameters
|
||||
* <p/>
|
||||
* <p>
|
||||
* This will be used to construct the URL in the API
|
||||
*
|
||||
* @return
|
||||
@@ -183,7 +183,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* The minimum release to include.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected format is YYYY-MM-DD.
|
||||
*
|
||||
* @param releaseDateGte
|
||||
@@ -196,7 +196,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* The maximum release to include.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected format is YYYY-MM-DD.
|
||||
*
|
||||
* @param releaseDateLte
|
||||
@@ -209,9 +209,9 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Only include movies with certifications for a specific country.
|
||||
* <p/>
|
||||
* <p>
|
||||
* When this value is specified, 'certificationLte' is required.
|
||||
* <p/>
|
||||
* <p>
|
||||
* A ISO 3166-1 is expected
|
||||
*
|
||||
* @param certificationCountry
|
||||
@@ -224,7 +224,7 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Only include movies with this certification and lower.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected value is a valid certification for the specified 'certificationCountry'.
|
||||
*
|
||||
* @param certificationLte
|
||||
@@ -337,11 +337,11 @@ public class Discover {
|
||||
|
||||
/**
|
||||
* Only include movies with the specified genres.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Expected value is an integer (the id of a genre).
|
||||
* <p/>
|
||||
* <p>
|
||||
* Multiple values can be specified.
|
||||
* <p/>
|
||||
* <p>
|
||||
* Comma separated indicates an 'AND' query, while a pipe (|) separated value indicates an 'OR'
|
||||
*
|
||||
* @param withGenres
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -29,6 +29,6 @@ import java.io.Serializable;
|
||||
@JsonRootName("keyword")
|
||||
public class Keyword extends AbstractIdName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Nothing to override from the base class.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class ListItem<T> extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -21,20 +21,29 @@ package com.omertron.themoviedbapi.model.list;
|
||||
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author Holger Brandl
|
||||
*/
|
||||
public class ListItemStatus extends AbstractJsonMapping implements Serializable {
|
||||
public class ListItemStatus extends AbstractJsonMapping {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 101L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@JsonProperty("status_code")
|
||||
private int statusCode;
|
||||
@JsonProperty("item_present")
|
||||
private boolean itemPresent;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -30,7 +30,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class UserList extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -29,7 +29,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*/
|
||||
public class AlternativeTitle implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MediaBasic extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MediaCreditList extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -31,7 +31,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MediaState extends AbstractJsonMapping implements Serializable, Identification {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -29,7 +29,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class RatedValue extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("value")
|
||||
private float value = -1f;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*/
|
||||
public class Trailer extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,39 +32,49 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
*/
|
||||
public class Translation extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("english_name")
|
||||
private String englishName;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String isoCode;
|
||||
private String language;
|
||||
@JsonProperty("name")
|
||||
private String name;
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
|
||||
public String getEnglishName() {
|
||||
return englishName;
|
||||
}
|
||||
|
||||
public String getIsoCode() {
|
||||
return isoCode;
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setEnglishName(String englishName) {
|
||||
this.englishName = englishName;
|
||||
}
|
||||
|
||||
public void setIsoCode(String isoCode) {
|
||||
this.isoCode = isoCode;
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Translation) {
|
||||
@@ -72,7 +82,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
||||
return new EqualsBuilder()
|
||||
.append(name, other.name)
|
||||
.append(englishName, other.englishName)
|
||||
.append(isoCode, other.isoCode)
|
||||
.append(language, other.language)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
@@ -83,7 +93,7 @@ public class Translation extends AbstractJsonMapping implements Serializable {
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder()
|
||||
.append(englishName)
|
||||
.append(isoCode)
|
||||
.append(language)
|
||||
.append(name)
|
||||
.toHashCode();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,12 +32,10 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
*/
|
||||
public class Video extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String language;
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
@JsonProperty("name")
|
||||
@@ -48,6 +46,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
private int size;
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String language;
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
@@ -77,6 +79,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
return language;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
@@ -105,6 +111,10 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof Video) {
|
||||
@@ -115,6 +125,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
.append(size, other.size)
|
||||
.append(key, other.key)
|
||||
.append(language, other.language)
|
||||
.append(country, other.country)
|
||||
.isEquals();
|
||||
} else {
|
||||
return false;
|
||||
@@ -130,6 +141,7 @@ public class Video extends AbstractJsonMapping implements Serializable {
|
||||
.append(key)
|
||||
.append(site)
|
||||
.append(language)
|
||||
.append(country)
|
||||
.toHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.enumeration.MediaType;
|
||||
import com.omertron.themoviedbapi.model.media.MediaBasic;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Basic Movie information
|
||||
@@ -31,8 +32,10 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class MovieBasic extends MediaBasic implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("_id")
|
||||
private String mediaId;
|
||||
@JsonProperty("adult")
|
||||
private boolean adult;
|
||||
@JsonProperty("original_title")
|
||||
@@ -45,11 +48,27 @@ public class MovieBasic extends MediaBasic implements Serializable {
|
||||
private Boolean video = null;
|
||||
@JsonProperty("rating")
|
||||
private float userRating = -1f;
|
||||
@JsonProperty("genre_ids")
|
||||
private List<Integer> genreIds;
|
||||
@JsonProperty("original_language")
|
||||
private String originalLanguage;
|
||||
@JsonProperty("overview")
|
||||
private String overview;
|
||||
@JsonProperty("revenue")
|
||||
private long revenue = 0L;
|
||||
|
||||
public MovieBasic() {
|
||||
super.setMediaType(MediaType.MOVIE);
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
public boolean isAdult() {
|
||||
return adult;
|
||||
}
|
||||
@@ -86,7 +105,7 @@ public class MovieBasic extends MediaBasic implements Serializable {
|
||||
return video;
|
||||
}
|
||||
|
||||
public void setVideo(boolean video) {
|
||||
public void setVideo(Boolean video) {
|
||||
this.video = video;
|
||||
}
|
||||
|
||||
@@ -97,4 +116,36 @@ public class MovieBasic extends MediaBasic implements Serializable {
|
||||
public void setUserRating(float userRating) {
|
||||
this.userRating = userRating;
|
||||
}
|
||||
|
||||
public List<Integer> getGenreIds() {
|
||||
return genreIds;
|
||||
}
|
||||
|
||||
public void setGenreIds(List<Integer> genreIds) {
|
||||
this.genreIds = genreIds;
|
||||
}
|
||||
|
||||
public String getOriginalLanguage() {
|
||||
return originalLanguage;
|
||||
}
|
||||
|
||||
public void setOriginalLanguage(String originalLanguage) {
|
||||
this.originalLanguage = originalLanguage;
|
||||
}
|
||||
|
||||
public String getOverview() {
|
||||
return overview;
|
||||
}
|
||||
|
||||
public void setOverview(String overview) {
|
||||
this.overview = overview;
|
||||
}
|
||||
|
||||
public long getRevenue() {
|
||||
return revenue;
|
||||
}
|
||||
|
||||
public void setRevenue(long revenue) {
|
||||
this.revenue = revenue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -53,13 +53,13 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Movie Bean
|
||||
* Movie Info
|
||||
*
|
||||
* @author stuart.boston
|
||||
*/
|
||||
public class MovieInfo extends MovieBasic implements Serializable, Identification, AppendToResponse<MovieMethod> {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("belongs_to_collection")
|
||||
private Collection belongsToCollection;
|
||||
@@ -71,18 +71,12 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
private String homepage;
|
||||
@JsonProperty("imdb_id")
|
||||
private String imdbID;
|
||||
@JsonProperty("overview")
|
||||
private String overview;
|
||||
@JsonProperty("production_companies")
|
||||
private List<ProductionCompany> productionCompanies = Collections.emptyList();
|
||||
@JsonProperty("production_countries")
|
||||
private List<ProductionCountry> productionCountries = Collections.emptyList();
|
||||
@JsonProperty("revenue")
|
||||
private long revenue;
|
||||
@JsonProperty("runtime")
|
||||
private int runtime;
|
||||
@JsonProperty("original_language")
|
||||
private String originalLanguage;
|
||||
@JsonProperty("spoken_languages")
|
||||
private List<Language> spokenLanguages = Collections.emptyList();
|
||||
@JsonProperty("tagline")
|
||||
@@ -125,10 +119,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
return imdbID;
|
||||
}
|
||||
|
||||
public String getOverview() {
|
||||
return overview;
|
||||
}
|
||||
|
||||
public List<ProductionCompany> getProductionCompanies() {
|
||||
return productionCompanies;
|
||||
}
|
||||
@@ -137,10 +127,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
return productionCountries;
|
||||
}
|
||||
|
||||
public long getRevenue() {
|
||||
return revenue;
|
||||
}
|
||||
|
||||
public int getRuntime() {
|
||||
return runtime;
|
||||
}
|
||||
@@ -156,10 +142,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getOriginalLanguage() {
|
||||
return originalLanguage;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
// <editor-fold defaultstate="collapsed" desc="Setter methods">
|
||||
@@ -183,10 +165,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
this.imdbID = imdbID;
|
||||
}
|
||||
|
||||
public void setOverview(String overview) {
|
||||
this.overview = overview;
|
||||
}
|
||||
|
||||
public void setProductionCompanies(List<ProductionCompany> productionCompanies) {
|
||||
this.productionCompanies = productionCompanies;
|
||||
}
|
||||
@@ -195,10 +173,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
this.productionCountries = productionCountries;
|
||||
}
|
||||
|
||||
public void setRevenue(long revenue) {
|
||||
this.revenue = revenue;
|
||||
}
|
||||
|
||||
public void setRuntime(int runtime) {
|
||||
this.runtime = runtime;
|
||||
}
|
||||
@@ -214,10 +188,6 @@ public class MovieInfo extends MovieBasic implements Serializable, Identificatio
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setOriginalLanguage(String originalLanguage) {
|
||||
this.originalLanguage = originalLanguage;
|
||||
}
|
||||
// </editor-fold>
|
||||
|
||||
//<editor-fold defaultstate="collapsed" desc="AppendToResponse Getters">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -29,6 +29,6 @@ import java.io.Serializable;
|
||||
@JsonRootName("production_company")
|
||||
public class ProductionCompany extends AbstractIdName implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
// Nothing to override from the base class.
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2015 Stuart Boston
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
@@ -32,7 +32,7 @@ import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
@JsonRootName("production_country")
|
||||
public class ProductionCountry extends AbstractJsonMapping implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4L;
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("iso_3166_1")
|
||||
private String country;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.omertron.themoviedbapi.model.movie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.model.AbstractJsonMapping;
|
||||
|
||||
public class Release extends AbstractJsonMapping {
|
||||
|
||||
@JsonProperty("certification")
|
||||
private String certification;
|
||||
@JsonProperty("release_date")
|
||||
private String releaseDate;
|
||||
|
||||
public String getCertification() {
|
||||
return certification;
|
||||
}
|
||||
|
||||
public void setCertification(String certification) {
|
||||
this.certification = certification;
|
||||
}
|
||||
|
||||
public String getReleaseDate() {
|
||||
return releaseDate;
|
||||
}
|
||||
|
||||
public void setReleaseDate(String releaseDate) {
|
||||
this.releaseDate = releaseDate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2016 Stuart Boston
|
||||
*
|
||||
* This file is part of TheMovieDB API.
|
||||
*
|
||||
* TheMovieDB API is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* TheMovieDB API is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with TheMovieDB API. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model.movie;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonSetter;
|
||||
import com.omertron.themoviedbapi.enumeration.ReleaseType;
|
||||
|
||||
public class ReleaseDate extends Release {
|
||||
|
||||
private static final long serialVersionUID = 100L;
|
||||
|
||||
@JsonProperty("note")
|
||||
private String note;
|
||||
@JsonProperty("iso_639_1")
|
||||
private String language;
|
||||
private ReleaseType releaseType;
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public ReleaseType getType() {
|
||||
return releaseType;
|
||||
}
|
||||
|
||||
@JsonSetter("type")
|
||||
public void setType(int type) {
|
||||
this.releaseType = ReleaseType.fromInteger(type);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user