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

@ -40,6 +40,21 @@ public class PlaylistClient {
return playlistService.getPlaylist(subsonic.getParams(), id);
}
public Call<SubsonicResponse> createPlaylist(String playlistId, String name, String songId) {
Log.d(TAG, "createPlaylist()");
return playlistService.createPlaylist(subsonic.getParams(), playlistId, name, songId);
}
public Call<SubsonicResponse> updatePlaylist(String playlistId, String name, boolean isPublic, String songIdToAdd, String songIndexToRemove) {
Log.d(TAG, "updatePlaylist()");
return playlistService.updatePlaylist(subsonic.getParams(), playlistId, name, isPublic, songIdToAdd, songIndexToRemove);
}
public Call<SubsonicResponse> deletePlaylist(String id) {
Log.d(TAG, "deletePlaylist()");
return playlistService.deletePlaylist(subsonic.getParams(), id);
}
private OkHttpClient getOkHttpClient() {
return new OkHttpClient.Builder()
.addInterceptor(getHttpLoggingInterceptor())

View file

@ -15,4 +15,13 @@ public interface PlaylistService {
@GET("getPlaylist")
Call<SubsonicResponse> getPlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
@GET("createPlaylist")
Call<SubsonicResponse> createPlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("songId") String songId);
@GET("updatePlaylist")
Call<SubsonicResponse> updatePlaylist(@QueryMap Map<String, String> params, @Query("playlistId") String playlistId, @Query("name") String name, @Query("public") boolean isPublic, @Query("songIdToAdd") String songIdToAdd, @Query("songIndexToRemove") String songIndexToRemove);
@GET("deletePlaylist")
Call<SubsonicResponse> deletePlaylist(@QueryMap Map<String, String> params, @Query("id") String id);
}