Search in sources :

Example 1 with GetAlbumListResponse

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

the class RESTMusicService method getAlbumList.

@Override
public MusicDirectory getAlbumList(String type, int size, int offset, Context context, ProgressListener progressListener) throws Exception {
    if (type == null) {
        throw new IllegalArgumentException("Type is null!");
    }
    updateProgressListener(progressListener, R.string.parser_reading);
    Response<GetAlbumListResponse> response = subsonicAPIClient.getApi().getAlbumList(AlbumListType.fromName(type), size, offset, null, null, null, null).execute();
    checkResponseSuccessful(response);
    List<MusicDirectory.Entry> childList = APIMusicDirectoryConverter.toDomainEntityList(response.body().getAlbumList());
    MusicDirectory result = new MusicDirectory();
    result.addAll(childList);
    return result;
}
Also used : MusicDirectory(org.moire.ultrasonic.domain.MusicDirectory) GetAlbumListResponse(org.moire.ultrasonic.api.subsonic.response.GetAlbumListResponse)

Aggregations

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