wtekiela / opensub4j

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

Getting ClassCastException while downloading subtitles for an user whose daily limit is reached #26

Closed arrajeev87 closed 3 years ago

arrajeev87 commented 3 years ago

When we try to download subtitles for an user whose daily limit is reached we get the below response,

{seconds=0.004, data=false, status=407 Download limit reached}

The data is false here where are we are expecting a list because of which we get the below exception.

Response: {seconds=0.004, data=false, status=407 Download limit reached} java.lang.ClassCastException: java.lang.Boolean cannot be cast to [Ljava.lang.Object; at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.executeListFieldBinding(ResponseParser.java:122) at com.github.wtekiela.opensub4j.impl.ResponseParser$FieldBindingTask.run(ResponseParser.java:107) at com.github.wtekiela.opensub4j.impl.ResponseParser.bind(ResponseParser.java:51) at com.github.wtekiela.opensub4j.impl.AbstractListOperation.execute(AbstractListOperation.java:25) at com.github.wtekiela.opensub4j.impl.OpenSubtitlesClientImpl.downloadSubtitles(OpenSubtitlesClientImpl.java:180)

wtekiela commented 3 years ago

NOTE: Fix for this bug introduces API incompatibility, ListResponse will now return Optional<List<T>> instead of List<T>.

wtekiela commented 3 years ago

Fxied in #28, released in 0.4.0