Giter Site home page Giter Site logo

api-omdb's People

Contributors

codemoth avatar omertron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-omdb's Issues

Long Plot bug

Hey,

Thanks for the awesome work with the API. However, I think there might be a bug upon requesting long plots from OMDb. For instance, if I request the movie with IMDb ID tt0000628 with a long plot OmdbVideoFull result = omdb.getInfo(new OmdbBuilder().setImdbId(imdbID).setPlot(PlotType.LONG).setTomatoesOn().build());

I get the following JSON response:
{"Title":"The Adventures of Dollie","Year":"1908","Rated":"NOT RATED","Released":"14 Jul 1908","Runtime":"12 min","Genre":"Action, Short","Director":"D.W. Griffith, G.W. Bitzer","Writer":"Stanner E.V. Taylor","Actors":"Arthur V. Johnson, Linda Arvidson, Gladys Egan, Charles Inslee","Plot":"On a warm and sunny summer's day, a mother and father take their young daughter Dollie on a riverside outing. A gypsy basket peddler happens along, and is angered when the mother refuses to...","Language":"English","Country":"USA","Awards":"N/A","Poster":"http://ia.media-imdb.com/images/M/MV5BMDlmYzgwZmItNzdlMS00ZmE5LThkYmUtYmNhNjAyY2FlMmFiXkEyXkFqcGdeQXVyMTYxNjkxOQ@@._V1_SX300.jpg","Metascore":"N/A","imdbRating":"5.7","imdbVotes":"443","imdbID":"tt0000628","Type":"movie","Response":"True"}

Note the "..." in the end of the plot result. This is the short version of the plot according to OMDb. The long version result should have been:
{"Title":"The Adventures of Dollie","Year":"1908","Rated":"NOT RATED","Released":"14 Jul 1908","Runtime":"12 min","Genre":"Action, Short","Director":"D.W. Griffith, G.W. Bitzer","Writer":"Stanner E.V. Taylor","Actors":"Arthur V. Johnson, Linda Arvidson, Gladys Egan, Charles Inslee","Plot":"On a warm and sunny summer's day, a mother and father take their young daughter Dollie on a riverside outing. A gypsy basket peddler happens along, and is angered when the mother refuses to...","Language":"English","Country":"USA","Awards":"N/A","Poster":"http://ia.media-imdb.com/images/M/MV5BMDlmYzgwZmItNzdlMS00ZmE5LThkYmUtYmNhNjAyY2FlMmFiXkEyXkFqcGdeQXVyMTYxNjkxOQ@@._V1_SX300.jpg","Metascore":"N/A","imdbRating":"5.7","imdbVotes":"443","imdbID":"tt0000628","Type":"movie","Response":"True"}

Could you please check it?

jar

can you please publish its jar?

OmdbApi : getInfo() and search() method should be updated to update APIKey only if parameters don't contain it already

OmdbApi.txt
Hi Team,

OmdbApi class needs to be updated for method getInfo() and search().
The following code needs to be added :
if (!parameters.has(Param.APIKEY)) { parameters.add(Param.APIKEY, this.apiKey); }
Current Design: As soon as request comes to API , it adds APIKey, which is fine if the client has used parameterised constructor to create Object. But problem comes when client has used default constructor to create object and passing APIKey in OMDBParameter list.
But since we are adding searchParams.add(Param.APIKEY, this.apiKey); , the value of APIKey ggets overridden in Omdbparameters with default null value.

Issue: User is forced to use OmdbApi object in application with APIKey, which might not be suitable for different user for different needs.
File with suggested code is attached

Documentation leak

Hi,

your API has a little documentation leak. I need several times to understand, when I make a OmdbAPI.search request with a OmbdBuilder.setTitle() parameter, the api-omdb-search doesn't return any results, because it makes a call to omdbapi.com/?t=... instead of omdbapi.com/?s=...

The reason is - the search() method wants to create a List of OmdbVideoBasic objects inside a SearchResult, but the builder produces a query with "t" Title - and then OmdbApi.com only returns one entry. And then the JSON Mapper doesn't match (matching an SearchResult entry to SearchResult) and the result is ok, but empty (List==null).
I found a lot of AbstractJsonMapper trace log messages, that the JSON data couldnt be mapped...

So - either add an example to the documentation so that the search should only be used with OmdbBuilder.setSearchTerm() and never use OmdbBuilder.setTitle() in a search or make the builder/parser more robust against this issue.

Key

It seems like they added key for omdb api. Would you please add it to your library?

Version 1.4 in Maven Central is incompatible with live OMDB

Currently the version of api-omdb available in Maven Central is 1.4 and since OMDB API requires a key to work, we need to use 1.5. Building projects with a local clone of 1.5 is inconvenient.

Can you please release 1.5 into Maven Central?

Add episode and season number

Hello,
Would be nice to be able to retrieve episde / season number, when working on a TVshows.

Can be easily done by adding

@JsonProperty("Season") private Integer season; @JsonProperty("Episode") private Integer episode ;

and appropriate getters/setters in OmdbVideoFull.java

Thanks for this nice wrapper :)

Error when one or more of omdb data is N/A

The api won't work if the data received from omdb contains one or more fields with the value "N/A"
For example: "Runtime":"N/A".
EDIT: Found out I was using version 1.0 and it was fixed since 1.1

Duplicated Search Results

There are some duplicates for search results tried searching s=marvel.
http://www.omdbapi.com/?apikey=<api_key>=marvel&type=movie&page=1
outputs duplicates like Captain Marvel:
{
"Search": [
{
"Title": "Captain Marvel",
"Year": "2019",
"imdbID": "tt4154664",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BMTE0YWFmOTMtYTU2ZS00ZTIxLWE3OTEtYTNiYzBkZjViZThiXkEyXkFqcGdeQXVyODMzMzQ4OTI@._V1_SX300.jpg"
},
{
"Title": "Captain Marvel",
"Year": "2019",
"imdbID": "tt4154664",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BMTE0YWFmOTMtYTU2ZS00ZTIxLWE3OTEtYTNiYzBkZjViZThiXkEyXkFqcGdeQXVyODMzMzQ4OTI@._V1_SX300.jpg"
},
{
"Title": "Marvel One-Shot: All Hail the King",
"Year": "2014",
"imdbID": "tt3438640",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BYTQzNzZiOWItOTNlMC00MjA4LWI5ZTAtODk3MmQ2MGJiYTdmXkEyXkFqcGdeQXVyNTgzMDMzMTg@._V1_SX300.jpg"
},
{
"Title": "Marvel One-Shot: Item 47",
"Year": "2012",
"imdbID": "tt2247732",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BMTM2MzY1ODcyN15BMl5BanBnXkFtZTcwNTE3OTIxOA@@._V1_SX300.jpg"
},
{
"Title": "Marvel One-Shot: Agent Carter",
"Year": "2013",
"imdbID": "tt3067038",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BYzYyODBjY2MtZGU3MC00YWE3LWExOTUtMzkyMjNkYjUzNjA4XkEyXkFqcGdeQXVyNjA3OTI5MjA@._V1_SX300.jpg"
},
{
"Title": "Marvel One-Shot: A Funny Thing Happened on the Way to Thor's Hammer",
"Year": "2011",
"imdbID": "tt2011109",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BYmIxYzk2ZTItNTE1OC00NWRkLTkyOTEtMDM1ZjY5MjJlYWE4XkEyXkFqcGdeQXVyNjA3OTI5MjA@._V1_SX300.jpg"
},
{
"Title": "Marvel One-Shot: The Consultant",
"Year": "2011",
"imdbID": "tt2011118",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BMThhNWExYzgtYzQwOS00MDM5LWFmOGYtOGZhZDQ4MWYzMDNlXkEyXkFqcGdeQXVyNjA3OTI5MjA@._V1_SX300.jpg"
},
{
"Title": "Adventures of Captain Marvel",
"Year": "1941",
"imdbID": "tt0033317",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BNjg0NTk3NjUyNF5BMl5BanBnXkFtZTgwNDQ5MjM1MjE@._V1_SX300.jpg"
},
{
"Title": "Marvel Studios: Assembling a Universe",
"Year": "2014",
"imdbID": "tt3591568",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BNTAzNzAwZDktOThhZC00NWZmLTg2MGItMDY1MDQ4OWQ4Yjc3XkEyXkFqcGdeQXVyNTE1NjY5Mg@@._V1_SX300.jpg"
},
{
"Title": "Pokémon the Movie: Volcanion and the Mechanical Marvel",
"Year": "2016",
"imdbID": "tt5889204",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BZTUwZDEzZGEtYTJlYi00OTRkLWJmMzItODU0ZWViMTUyYjUzXkEyXkFqcGdeQXVyNzEyMDQ1MDA@._V1_SX300.jpg"
}
],
"totalResults": "88",
"Response": "True"
}

Mapping error when metascore is "N/A"

Some tv shows have metascore returned as "N/A". For example "Mr. Robot" would return metascore as "N/A", yet in model the value is mapped as integer, so it throws a mapping error. Similar to this:

com.omertron.omdbapi.OMDBException: ExceptionType=MAPPING_FAILED, ResponseCode=0, URL=http://www.omdbapi.com/?i=tt4158110
    at com.omertron.omdbapi.OmdbApi.getInfo(OmdbApi.java:180)
    at tvseriestracker.TvSeriesTrackerApplication.main(TvSeriesTrackerApplication.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.lang.Integer from String value 'N/A': not a valid Integer value
 at [Source: {"Title":"Mr. Robot","Year":"2015–","Rated":"N/A","Released":"27 May 2015","Runtime":"60 min","Genre":"Crime, Drama","Director":"N/A","Writer":"Sam Esmail","Actors":"Rami Malek, Carly Chaikin, Portia Doubleday, Martin Wallström","Plot":"Follows a mysterious anarchist who recruits a young computer programmer (Malek) who suffers from social anxiety disorder and forms connections through hacking them.","Language":"English","Country":"USA","Awards":"1 win.","Poster":"http://ia.media-imdb.com/images/M/MV5BMTE0Mjc1MTk2MjFeQTJeQWpwZ15BbWU4MDk2NzI4MDYx._V1_SX300.jpg","Metascore":"N/A","imdbRating":"9.4","imdbVotes":"21,489","imdbID":"tt4158110","Type":"series","Response":"True"}; line: 1, column: 566] (through reference chain: com.omertron.omdbapi.model.OmdbVideoFull["Metascore"])
    at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:55)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.