mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 10:23:33 +00:00
Implemented scobble action
This commit is contained in:
parent
4fc29b47be
commit
6f1046b137
5 changed files with 136 additions and 4 deletions
|
|
@ -30,7 +30,8 @@ public class SongRepository {
|
|||
}
|
||||
|
||||
public MutableLiveData<List<Song>> getStarredSongs() {
|
||||
App.getSubsonicClientInstance(application, false).getAlbumSongListClient()
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getAlbumSongListClient()
|
||||
.getStarred2()
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
|
|
@ -51,7 +52,8 @@ public class SongRepository {
|
|||
}
|
||||
|
||||
public void getInstantMix(Song song, int count, MediaCallback callback) {
|
||||
App.getSubsonicClientInstance(application, false).getBrowsingClient()
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getBrowsingClient()
|
||||
.getSimilarSongs2(song.getId(), count)
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
|
|
@ -77,7 +79,8 @@ public class SongRepository {
|
|||
}
|
||||
|
||||
public void getRandomSample(int number, MediaCallback callback) {
|
||||
App.getSubsonicClientInstance(application, false).getAlbumSongListClient()
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getAlbumSongListClient()
|
||||
.getRandomSongs(number)
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
|
|
@ -97,4 +100,21 @@ public class SongRepository {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void scrobble(String id) {
|
||||
App.getSubsonicClientInstance(application, false)
|
||||
.getMediaAnnotationClient()
|
||||
.scrobble(id)
|
||||
.enqueue(new Callback<SubsonicResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<SubsonicResponse> call, Response<SubsonicResponse> response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue