Search in sources :

Example 1 with GetPlaylistResponse

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

the class RESTMusicService method getPlaylist.

@Override
public MusicDirectory getPlaylist(String id, String name, Context context, ProgressListener progressListener) throws Exception {
    if (id == null) {
        throw new IllegalArgumentException("id param is null!");
    }
    updateProgressListener(progressListener, R.string.parser_reading);
    Response<GetPlaylistResponse> response = subsonicAPIClient.getApi().getPlaylist(id).execute();
    checkResponseSuccessful(response);
    MusicDirectory playlist = APIPlaylistConverter.toMusicDirectoryDomainEntity(response.body().getPlaylist());
    savePlaylist(name, context, playlist);
    return playlist;
}
Also used : MusicDirectory(org.moire.ultrasonic.domain.MusicDirectory) GetPlaylistResponse(org.moire.ultrasonic.api.subsonic.response.GetPlaylistResponse)

Aggregations

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