Search in sources :

Example 1 with GetSongsByGenreResponse

use of org.moire.ultrasonic.api.subsonic.response.GetSongsByGenreResponse in project ultrasonic by ultrasonic.

the class RESTMusicService method getSongsByGenre.

@Override
public MusicDirectory getSongsByGenre(String genre, int count, int offset, Context context, ProgressListener progressListener) throws Exception {
    if (genre == null) {
        throw new IllegalArgumentException("Genre is null");
    }
    updateProgressListener(progressListener, R.string.parser_reading);
    Response<GetSongsByGenreResponse> response = subsonicAPIClient.getApi().getSongsByGenre(genre, count, offset, null).execute();
    checkResponseSuccessful(response);
    MusicDirectory result = new MusicDirectory();
    result.addAll(APIMusicDirectoryConverter.toDomainEntityList(response.body().getSongsList()));
    return result;
}
Also used : GetSongsByGenreResponse(org.moire.ultrasonic.api.subsonic.response.GetSongsByGenreResponse) MusicDirectory(org.moire.ultrasonic.domain.MusicDirectory)

Aggregations

GetSongsByGenreResponse (org.moire.ultrasonic.api.subsonic.response.GetSongsByGenreResponse)1 MusicDirectory (org.moire.ultrasonic.domain.MusicDirectory)1