kinyerakenneth / lastfm-java

Automatically exported from code.google.com/p/lastfm-java
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Library.getAlbums throws Eception #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

        PaginatedResult<Album> albums = Library.getAlbums("fillg1",  apiKey);

        System.out.println(albums.getTotalPages());
        System.out.println(albums.getPageResults().size());
        System.out.println(albums.getPageResults().iterator().next());

What is the expected output? What do you see instead?
I expect a PaginatedResult collection as document by the api documentation, but 
a get an exception instead

9.01.2014 15:08:00 de.umass.lastfm.Caller openConnection
INFO: Open connection: http://ws.audioscrobbler.com/2.0/
09.01.2014 15:08:00 de.umass.lastfm.Caller openPostConnection
INFO: Post body: 
method=library.getAlbums&limit=0&page=1&api_key=a1d56d7fa9a095f9bde7101de2cfaea8
&user=fillg1
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at java.lang.Integer.parseInt(Unknown Source)
    at de.umass.lastfm.ResponseBuilder.buildPaginatedResult(ResponseBuilder.java:99)
    at de.umass.lastfm.ResponseBuilder.buildPaginatedResult(ResponseBuilder.java:85)
    at de.umass.lastfm.ResponseBuilder.buildPaginatedResult(ResponseBuilder.java:76)
    at de.umass.lastfm.Library.getAlbums(Library.java:150)
    at de.umass.lastfm.Library.getAlbums(Library.java:120)
    at de.illgner.lastfm.Cleaner.main(Cleaner.java:17)

What version of the product are you using? On what operating system?
I am using the version 0.1.2 from maven central on Windows 7.

Please provide any additional information below.
Libray.getAllAlbums() gives a similar exception

Original issue reported on code.google.com by Michael....@gmail.com on 9 Jan 2014 at 2:21