2015-09-02, 18:55
I'm developing a cross platform desktop remote for Kodi called ReKodi. One of its features is to allow users to create playlists and save them locally. Each playlist contains all the related 'file'-paths, as provided by Kodi. Now I want the users to be able to open (and apply) a locally stored playlist. In my case that means looping through an array and calling Playlist.Add or Playlist.Insert at each iteration, providing the playlistid and file path (and in case of Playlist.Insert the position) as parameters.
I don't really like this way of doing this, because it's dirty to make api requests in a loop. Apart from that it's killing my websocket connection after 5 requests. So the connection is being closed momentarily and only 5 items are being added to the playlist. I can see why. Probably this is some kind of security feature.
Ideally I would like to be able to send and array of files, albumids, episodeids, etc.... But that doesn't seem to be possible. Or am I mistaking?
The api client I'm using does not seem to be prepared for batch requests and I'm really liking it as is. Modifying it to support batch requests would be my last resort. Is there any way to achieve my wish without having to use batch request?
I don't really like this way of doing this, because it's dirty to make api requests in a loop. Apart from that it's killing my websocket connection after 5 requests. So the connection is being closed momentarily and only 5 items are being added to the playlist. I can see why. Probably this is some kind of security feature.
Ideally I would like to be able to send and array of files, albumids, episodeids, etc.... But that doesn't seem to be possible. Or am I mistaking?
The api client I'm using does not seem to be prepared for batch requests and I'm really liking it as is. Modifying it to support batch requests would be my last resort. Is there any way to achieve my wish without having to use batch request?