xbmc.PLAYLIST_VIDEO weird inconsistency + ghost items - any ideas?
#1
Ive been setting up a service addon on my system to do stuff and one of the things it does is present a "Next Up" window for the next episode of whatever show I am watching.

I am therefore generating a list item with the correct information for the next episode to link to this window and am adding the item to the "xbmc.PLAYLIST_VIDEO" playlist and playing it next when the button is clicked or you move to the next episode.

However ive found that on different kodi boxes the "xbmc.PLAYLIST_VIDEO" playlist will not act consistently, on one box I need to clear the playlist every time and start it with an exception when I seek past the end of the episode, as it wont skip to the next episode on its own without this prompting.

On another box it will skip to the next episode fine on its own (no exception generated) without having to clear the playlist and trigger its playback manually, but old items in the playlist start to show the wrong episode information.
And during development where I was clearing the playlist, it would occasionally play the correct next episode but show the information for an item which had been  cleared from the playlist before the new item was added.
I had it outputing the exact information for the item I had just populated to the playlist to the logs, and it would still persist in showing information on the OSD and via JSON for an item which no longer exists.


So does anyone know why im getting such inconsistency on the exact same version of kodi on two different systems? Why does one box not play the next item in the playlist without capturing an exception while the other appears to work fine.
Why do old items in the playlist show in the wrong order and with the wrong information?

Why whenever I have set it up to remove the old items (by having my code remember the old filenames, because removing a specific playlist index item is currently not supported by kodi) do items with the filenames I have already removed still appear in the playlist?

What are these ghost items in the playlist?
The xbmc.PLAYLIST_VIDEO playlist cant really be interrogated as far as im aware, so its pretty hard to know whats actually going on.
Reply
#2
(2020-12-07, 13:29)henryjfry Wrote: Ive been setting up a service addon on my system to do stuff and one of the things it does is present a "Next Up" window for the next episode of whatever show I am watching.

I am therefore generating a list item with the correct information for the next episode to link to this window and am adding the item to the "xbmc.PLAYLIST_VIDEO" playlist and playing it next when the button is clicked or you move to the next episode.

However ive found that on different kodi boxes the "xbmc.PLAYLIST_VIDEO" playlist will not act consistently, on one box I need to clear the playlist every time and start it with an exception when I seek past the end of the episode, as it wont skip to the next episode on its own without this prompting.

On another box it will skip to the next episode fine on its own (no exception generated) without having to clear the playlist and trigger its playback manually, but old items in the playlist start to show the wrong episode information.
And during development where I was clearing the playlist, it would occasionally play the correct next episode but show the information for an item which had been  cleared from the playlist before the new item was added.
I had it outputing the exact information for the item I had just populated to the playlist to the logs, and it would still persist in showing information on the OSD and via JSON for an item which no longer exists.


So does anyone know why im getting such inconsistency on the exact same version of kodi on two different systems? Why does one box not play the next item in the playlist without capturing an exception while the other appears to work fine.
Why do old items in the playlist show in the wrong order and with the wrong information?

Why whenever I have set it up to remove the old items (by having my code remember the old filenames, because removing a specific playlist index item is currently not supported by kodi) do items with the filenames I have already removed still appear in the playlist?

What are these ghost items in the playlist?
The xbmc.PLAYLIST_VIDEO playlist cant really be interrogated as far as im aware, so its pretty hard to know whats actually going on.

Ok so I think I have resolved the problems I was having with the information in this post:

https://forum.kodi.tv/showthread.php?tid=335755

The important parts being creating the list item, adding it to the playlist and then addDirectoryItem and endOfDirectory.

I was already doing "addDirectoryItem" but this was happening before I added the playlist item and I wasnt doing "endOfDirectory" previously at all.
The documentation doesnt make this at all clear so it fortunate I found that post.

The playlist.remove() part I have in my code doesnt appear to do anything, however, which isnt really a problem. However it doesnt seem to trigger onplaybackstarted when you move to a different item in the playlist.
I think I could do something with "onAVChange" and test what it thinks is the current file against the playing file, but if my onplaybackstarted is currently stuck in a while playing loop, I could return. But that still wouldnt go back to the start of onplayback started, without a goto or something.

Anyway correctly adding the item to the playlist seems to work and I tend to skip to the next episode or use my window so im happy enough not to actually hit the next button, but that seems like a bit of a clanger, that it doesnt recognise a new file is actually playing.
Im not sure if I can bother next proofing all the parts of my code just because kodi doesnt announce its actually playing the next file.
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.PLAYLIST_VIDEO weird inconsistency + ghost items - any ideas?0