Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Movies api #174

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/info/movito/themoviedbapi/TmdbAccount.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package info.movito.themoviedbapi;

import info.movito.themoviedbapi.model.MovieListResultsPage;
import info.movito.themoviedbapi.model.movies.MovieListResultsPage;
import info.movito.themoviedbapi.model.account.Account;
import info.movito.themoviedbapi.model.core.MovieResultsPage;
import info.movito.themoviedbapi.model.core.TvSeriesResultsPage;
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/info/movito/themoviedbapi/TmdbCollections.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package info.movito.themoviedbapi;

import info.movito.themoviedbapi.model.Artwork;
import info.movito.themoviedbapi.model.ArtworkType;
import info.movito.themoviedbapi.model.CollectionInfo;
import info.movito.themoviedbapi.model.collections.Images;
import info.movito.themoviedbapi.model.collections.Translation;
import info.movito.themoviedbapi.model.collections.Translations;
import info.movito.themoviedbapi.model.core.image.CollectionImages;
import info.movito.themoviedbapi.tools.ApiUrl;
import info.movito.themoviedbapi.tools.TmdbException;

Expand Down Expand Up @@ -50,11 +48,11 @@ public CollectionInfo getDetails(Integer collectionId, String language) throws T
* @return The images.
* @throws TmdbException If there was an error making the request or mapping the response.
*/
public List<Artwork> getImages(Integer collectionId, String language, String... includeImageLanguage) throws TmdbException {
public Images getImages(Integer collectionId, String language, String... includeImageLanguage) throws TmdbException {
ApiUrl apiUrl = new ApiUrl(TMDB_METHOD_COLLECTION, collectionId, "images");
apiUrl.addLanguage(language);
apiUrl.addQueryParamCommandSeparated("include_image_language", includeImageLanguage);
return mapJsonResult(apiUrl, CollectionImages.class).getAll(ArtworkType.POSTER, ArtworkType.BACKDROP);
return mapJsonResult(apiUrl, Images.class);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import info.movito.themoviedbapi.model.configuration.Job;
import info.movito.themoviedbapi.model.configuration.Configuration;
import info.movito.themoviedbapi.model.configuration.Country;
import info.movito.themoviedbapi.model.configuration.Language;
import info.movito.themoviedbapi.model.core.Language;
import info.movito.themoviedbapi.model.configuration.Timezone;
import info.movito.themoviedbapi.tools.ApiUrl;
import info.movito.themoviedbapi.tools.TmdbException;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/info/movito/themoviedbapi/TmdbLists.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package info.movito.themoviedbapi;

import info.movito.themoviedbapi.model.ListItemStatus;
import info.movito.themoviedbapi.model.MovieList;
import info.movito.themoviedbapi.model.movies.MovieList;
import info.movito.themoviedbapi.model.MovieListCreationStatus;
import info.movito.themoviedbapi.model.core.SessionToken;
import info.movito.themoviedbapi.model.core.responses.ResponseStatus;
Expand Down
489 changes: 226 additions & 263 deletions src/main/java/info/movito/themoviedbapi/TmdbMovies.java

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/java/info/movito/themoviedbapi/TmdbPeople.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import info.movito.themoviedbapi.model.people.Translations;
import info.movito.themoviedbapi.model.people.credits.CombinedPersonCredits;
import info.movito.themoviedbapi.model.people.credits.MovieCredits;
import info.movito.themoviedbapi.model.people.credits.Person;
import info.movito.themoviedbapi.model.people.Person;
import info.movito.themoviedbapi.model.people.credits.TvCredits;
import info.movito.themoviedbapi.tools.ApiUrl;
import info.movito.themoviedbapi.tools.TmdbException;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/info/movito/themoviedbapi/TmdbReviews.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package info.movito.themoviedbapi;

import info.movito.themoviedbapi.model.Review;
import info.movito.themoviedbapi.model.reviews.Review;
import info.movito.themoviedbapi.tools.ApiUrl;
import info.movito.themoviedbapi.tools.TmdbException;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/info/movito/themoviedbapi/TmdbSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import info.movito.themoviedbapi.model.Collection;
import info.movito.themoviedbapi.model.Company;
import info.movito.themoviedbapi.model.MovieListResultsPage;
import info.movito.themoviedbapi.model.movies.MovieListResultsPage;
import info.movito.themoviedbapi.model.Multi;
import info.movito.themoviedbapi.model.core.MovieDbResultsPage;
import info.movito.themoviedbapi.model.core.ResultsPage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public ProviderResults getMovieProviders(String language, String watchRegion) th

/**
* <p>Get the list of streaming providers we have for TV shows.</p>
* <p>In order to use this data you must attribute the source of the data as JustWatch. If TMDb find any usage not complying with these
* terms TMDb will revoke access to the API.</p>
* <p>See the <a href="https://developer.themoviedb.org/reference/watch-provider-tv-list">documentation</a>
* for more info.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ public class AlternativeTitle extends AbstractJsonMapping {

@JsonProperty("title")
private String title;

@JsonProperty("type")
private String type;
}
4 changes: 1 addition & 3 deletions src/main/java/info/movito/themoviedbapi/model/Artwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@EqualsAndHashCode(callSuper = false)
public class Artwork extends AbstractJsonMapping {
@JsonProperty("iso_639_1")
private String language;
private String iso6391;

@JsonProperty("file_path")
private String filePath;
Expand All @@ -28,6 +28,4 @@ public class Artwork extends AbstractJsonMapping {

@JsonProperty("vote_count")
private Integer voteCount;

private ArtworkType artworkType = ArtworkType.POSTER;
}
21 changes: 0 additions & 21 deletions src/main/java/info/movito/themoviedbapi/model/ArtworkType.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import info.movito.themoviedbapi.model.core.AbstractJsonMapping;
import info.movito.themoviedbapi.model.people.credits.Person;
import info.movito.themoviedbapi.model.people.Person;
import info.movito.themoviedbapi.model.movies.MovieDb;
import info.movito.themoviedbapi.model.tv.TvSeriesDb;
import lombok.Data;
import lombok.EqualsAndHashCode;
Expand Down
18 changes: 0 additions & 18 deletions src/main/java/info/movito/themoviedbapi/model/Language.java

This file was deleted.

193 changes: 0 additions & 193 deletions src/main/java/info/movito/themoviedbapi/model/MovieDb.java

This file was deleted.

3 changes: 2 additions & 1 deletion src/main/java/info/movito/themoviedbapi/model/Multi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import info.movito.themoviedbapi.model.people.credits.Person;
import info.movito.themoviedbapi.model.people.Person;
import info.movito.themoviedbapi.model.movies.MovieDb;
import info.movito.themoviedbapi.model.people.PersonDb;
import info.movito.themoviedbapi.model.tv.TvSeriesDb;

Expand Down
Loading
Loading