Added playlist creator and editor

This commit is contained in:
CappielloAntonio 2021-08-12 12:50:42 +02:00
parent 00b85e5bc2
commit d2092f5239
14 changed files with 589 additions and 1 deletions

View file

@ -77,4 +77,42 @@ public class PlaylistRepository {
return listLivePlaylistSongs;
}
public void addSongToPlaylist(String playlistId, String songId) {
App.getSubsonicClientInstance(application, false)
.getPlaylistClient()
.updatePlaylist(playlistId, null, true, songId, null)
.enqueue(new Callback<SubsonicResponse>() {
@Override
public void onResponse(Call<SubsonicResponse> call, Response<SubsonicResponse> response) {
if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
}
}
@Override
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
}
});
}
public void createPlaylist(String name, String songId) {
App.getSubsonicClientInstance(application, false)
.getPlaylistClient()
.createPlaylist(null, name, songId)
.enqueue(new Callback<SubsonicResponse>() {
@Override
public void onResponse(Call<SubsonicResponse> call, Response<SubsonicResponse> response) {
if (response.body().getStatus().getValue().equals(ResponseStatus.OK)) {
}
}
@Override
public void onFailure(Call<SubsonicResponse> call, Throwable t) {
}
});
}
}