PlaylistService add action creates unusable playlist in API v3

2 replies [Last post]
Joined: 08/21/2009
Points: 23

Using the V3 API, if you start an admin session and add a new Playlist using the playlist service's add method, KalturaCE creates a record in the entry table in the DB, but it sets the kuser_id to NULL. When the kuser_id is NULL you cannot manage the playlist from the KMC or retrieve it using the list action on the playlist service.

If you manually edit the record that was created by the add to change the kuser_id field in the DB to a non-NULL value, say "3", the playlist then shows up in the list and you can successfully manage it in the KMC and retrieve it with a list call. I noticed the kshow_id also gets set to NULL but that alone doesn't foul up the playlist.

Here's the code using the new V3 API Java client if you are interested:

KalturaPlaylist playlist = new KalturaPlaylist();                      
playlist.name = "Test playlist";
playlist.description = "Playlist unit test";
playlist.playlistType = KalturaPlaylistType.STATIC_LIST;
playlist.playlistContent = "dwygyeikas,iqhubczu14";
KalturaPlaylist addedPlaylist = playlistService.add(playlist);
assertNotNull(addedPlaylist);                  
String addedPlaylistId = addedPlaylist.id;
assertNotNull(addedPlaylistId);

// find the playlist
playlistList = playlistService.list();
                                               
boolean foundPlaylist = false;
for (KalturaPlaylist aPlaylist : playlistList.objects) {
        if (aPlaylist.id.equals(addedPlaylistId)) foundPlaylist = true;
}
assertTrue(foundPlaylist);   // THIS FAILS unless you manually set kuser_id in the DB

Anyone know why kuser_id is being set to NULL when a playlist is added from the API?

Jeff

Joined: 05/18/2009
Points: 13
Joined: 08/21/2009
Points: 23

Cool. Thanks for the link. Glad it's fixed.

I thought I should expect to see the fix in HEAD at svn://www.kaltura.org/usr/local/kalorg but it looks like they only have tagged/released branches in there. Am I missing something?

Jeff