ChriD / node-raumkernel

A nodeJs lib for controlling the raumfeld multiroom system
MIT License
17 stars 7 forks source link

Create/Update/Delete native RF "Playlists" #15

Closed ChriD closed 7 years ago

ChriD commented 7 years ago

Create/Update/Delete native RF "Playlists" as given in the "My Playlists" node

ChriD commented 7 years ago

Playlist now can be created and deleted by using the playlistController

e.g.

 raumkernel.nativePlaylistController.createPlaylist("RAUMKERNELTEST").then(function(){
     raumkernel.nativePlaylistController.deletePlaylist("RAUMKERNELTEST");
});
ChriD commented 7 years ago

Rename of playlist works too

raumkernel.nativePlaylistController.createPlaylist("RAUMKERNELTEST").then(function(){
            raumkernel.nativePlaylistController.renamePlaylist("RAUMKERNELTEST", "RAUMKERNELTEST X")
        });

Pulled with 1.0.13

ChriD commented 7 years ago

Playlist items can now be added, deleted and beeing removed. Example:

// Add a container item to playlist (That means an item which direct childs are tracks)
raumkernel.nativePlaylistController.addItemToPlaylist("RAUMKERNELTEST", "0/My Music/Artists/4%20Non%20Blondes/4%20Non%20Blondes+What%27s%20Up", 294967295, true);

// Add one item to playlist. Here the mediaItemid is a track
raumkernel.nativePlaylistController.addItemToPlaylist("RAUMKERNELTEST", "0/My Music/Artists/Dido/Dido+No%20Angel/c7e7ad4423927a75c5017b2640db6574");

// Move an item in playlist to position 2 (index starts with 0)
raumkernel.nativePlaylistController.moveItemInPlaylist("RAUMKERNELTEST", "0/Playlists/MyPlaylists/RAUMKERNELTEST/31990", 1);

// Remove first and second item from playlist
raumkernel.nativePlaylistController.removeItemsFromPlaylist("RAUMKERNELTEST", 0, 1);