Closed meoyawn closed 7 years ago
+1
Steps to reproduce:
Search last.fm with Track query:
Collection
Expected results: An empty or non empty collection returned from search. Actual results: The following stacktrace:
INFO: Post body: method=track.search&limit=10&track=Mother&artist=The+Police&api_key=xyz
java.lang.NumberFormatException: For input string: "FIXME"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:580)
at java.lang.Integer.parseInt(Integer.java:615)
at de.umass.lastfm.MusicEntry.loadStandardInfo(MusicEntry.java:207)
at de.umass.lastfm.Track$TrackFactory.createItemFromElement(Track.java:697)
at de.umass.lastfm.Track$TrackFactory.createItemFromElement(Track.java:694)
at de.umass.lastfm.ResponseBuilder.buildCollection(ResponseBuilder.java:70)
at de.umass.lastfm.ResponseBuilder.buildCollection(ResponseBuilder.java:61)
at de.umass.lastfm.Track.search(Track.java:216)
...
I have verified adelnizamutdinov's fix by consuming a release (https://github.com/kgilmer/lastfm-java/releases/tag/0.1.3) with it into my project via jitpack.
I'm still not sure how I include your solution to my project. :(
@AnujDutt2701 use https://jitpack.io/#adelnizamutdinov/lastfm-java/827407b4e2
@adelnizamutdinov I still get the same error.
Any other fix that may be available for this? I'm stuck at the moment,
Thanks for this fix, merging this now finally.
I believe an easier fix for this issue would be to replace the whole definition with just boolean streamable = "1".equals(s);
so feel free to update this PR later.
Solution: optional int parsing