2010-10-03, 19:13
MKay Wrote:Can anyone tell me how to handle virtual playlists correctly?
Actually i only need an AudioPlaylist (and of course a VideoPlaylist) where i can add and remove songs and play a specific item. Everything works fine with the JSON-API except that there is no remove-method for AudioPlaylist and VideoPlaylist.
But there is a remove-method for virtual playlists. So i considered to use virtual playlists. But i don't know how to handle them correctly.
I know i can use Playlist.Create to create a v-playlist and Playlist.Add to add songs, albums and files. And then i can use XBMC.Play to play the v-playlist. But what about playlist changes? For example i remove some elements from the v-playlist. How do i pass the new v-playlist to the currently playing one without stopping the current song or restarting the playlist from the beginning?
Sadly the whole playlist management is flawed, even in xbmc core. This reflects why the API is very flaky on playlists.
Ideally starting a virtual playlist and you should probably be able to remove from it and it reflects in GUI. However this is not the case.
If you create and add items to a virtual playlist and start playing it there is no way to update / sync it without restarting the playback.
Playlist management is something that we really need to fix for eden.
EDIT: And when now I see remove and insert is commited to svn http://trac.xbmc.org/changeset/34390 will check if its backportable