wtekiela / opensub4j

Java library for communicating with opensubtitles.org XML-RPC API
Other
47 stars 19 forks source link

searchMoviesOnImdb fails to parse result where id is long #34

Closed richard-strate closed 1 year ago

richard-strate commented 3 years ago

Seen in release 0.4.1

When I execute a query like this:

osClient.searchMoviesOnImdb("one flew over the cuckoo's nest");

The parsing of the MovieInfo-response fails:

java.lang.NumberFormatException: For input string: "1989193839205"
    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
    at java.base/java.lang.Integer.parseInt(Integer.java:658)
    at java.base/java.lang.Integer.parseInt(Integer.java:776)
    at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.parse(ResponseParser.java:217)
    at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.executePrimitiveFieldBinding(ResponseParser.java:143)
    at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.run(ResponseParser.java:131)
    at com.github.wtekiela.opensub4j.impl.ResponseParser.bind(ResponseParser.java:85)
    at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.executeListFieldBinding(ResponseParser.java:158)
    at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.run(ResponseParser.java:133)
    at com.github.wtekiela.opensub4j.impl.ResponseParser.bind(ResponseParser.java:74)
    at com.github.wtekiela.opensub4j.impl.AbstractListOperation.execute(AbstractListOperation.java:25)
    at com.github.wtekiela.opensub4j.impl.OpenSubtitlesClientImpl.searchMoviesOnImdb(OpenSubtitlesClientImpl.java:187)

I assume that MovieInfo#id field should be long instead of int? Couldn't find any xmlrpc-api documents in opensubtitles to confirm this.

linjonh commented 1 year ago

Yes it is, we could download the repos to modify it.

wtekiela commented 1 year ago

Fixed: https://github.com/wtekiela/opensub4j/commit/3dcc67ef4f7722c1ff53f971962464f705655514

wtekiela commented 1 year ago

0.4.2: https://github.com/wtekiela/opensub4j/commit/950c5139e26f4336e33000172c61071a06adb5fd