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;
}
Aggregations