mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-05-10 12:31:06 +03:00
Use new subsonic api unstar call.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
34b49f67a2
commit
23ee01d0f5
@ -334,43 +334,21 @@ public class RESTMusicService implements MusicService
|
|||||||
checkResponseSuccessful(response);
|
checkResponseSuccessful(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void unstar(String id, String albumId, String artistId, Context context, ProgressListener progressListener) throws Exception
|
public void unstar(String id,
|
||||||
{
|
String albumId,
|
||||||
checkServerVersion(context, "1.8", "Unstarring not supported.");
|
String artistId,
|
||||||
|
Context context,
|
||||||
|
ProgressListener progressListener) throws Exception {
|
||||||
|
Long apiId = id == null ? null : Long.valueOf(id);
|
||||||
|
Long apiAlbumId = albumId == null ? null : Long.valueOf(albumId);
|
||||||
|
Long apiArtistId = artistId == null ? null : Long.valueOf(artistId);
|
||||||
|
|
||||||
List<String> parameterNames = new LinkedList<String>();
|
updateProgressListener(progressListener, R.string.parser_reading);
|
||||||
List<Object> parameterValues = new LinkedList<Object>();
|
Response<SubsonicResponse> response = subsonicAPIClient.getApi()
|
||||||
|
.unstar(apiId, apiAlbumId, apiArtistId).execute();
|
||||||
if (id != null)
|
checkResponseSuccessful(response);
|
||||||
{
|
}
|
||||||
parameterNames.add("id");
|
|
||||||
parameterValues.add(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (albumId != null)
|
|
||||||
{
|
|
||||||
parameterNames.add("albumId");
|
|
||||||
parameterValues.add(albumId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (artistId != null)
|
|
||||||
{
|
|
||||||
parameterNames.add("artistId");
|
|
||||||
parameterValues.add(artistId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Reader reader = getReader(context, progressListener, "unstar", null, parameterNames, parameterValues);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new ErrorParser(context).parse(reader);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Util.close(reader);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MusicDirectory getMusicDirectory(String id, String name, boolean refresh, Context context, ProgressListener progressListener) throws Exception
|
public MusicDirectory getMusicDirectory(String id, String name, boolean refresh, Context context, ProgressListener progressListener) throws Exception
|
||||||
|
Loading…
x
Reference in New Issue
Block a user