mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-27 08:57:44 +01:00
Use new subsonic api star request.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
fdd9540f75
commit
864488510c
@ -318,40 +318,19 @@ public class RESTMusicService implements MusicService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void star(String id, String albumId, String artistId, Context context, ProgressListener progressListener) throws Exception
|
public void star(String id,
|
||||||
{
|
String albumId,
|
||||||
checkServerVersion(context, "1.8", "Starring 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()
|
||||||
|
.star(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, "star", null, parameterNames, parameterValues);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
new ErrorParser(context).parse(reader);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Util.close(reader);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -153,12 +153,12 @@ public class AlbumView extends UpdateView
|
|||||||
album.setStarred(false);
|
album.setStarred(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final MusicService musicService = MusicServiceFactory.getMusicService(view.getContext());
|
||||||
new Thread(new Runnable()
|
new Thread(new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
MusicService musicService = MusicServiceFactory.getMusicService(null);
|
|
||||||
boolean useId3 = Util.getShouldUseId3Tags(getContext());
|
boolean useId3 = Util.getShouldUseId3Tags(getContext());
|
||||||
|
|
||||||
try
|
try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user