mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 02:13:33 +00:00
Implemented rating system for song, album and artist (album and artist do not retrieve rating from server)
This commit is contained in:
parent
055ac44cf6
commit
e2ddbdf6c9
15 changed files with 303 additions and 7 deletions
|
|
@ -230,4 +230,27 @@ public class SongRepository {
|
|||
|
||||
return songsByGenre;
|
||||
}
|
||||
|
||||
public MutableLiveData<Song> getSong(String id) {
|
||||
MutableLiveData<Song> song = new MutableLiveData<>();
|
||||
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getBrowsingClient()
|
||||
.getSong(id)
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, Response<SubsonicResponse> response) {
|
||||
if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
|
||||
song.setValue(MappingUtil.mapSong(response.body().getSong()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return song;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue