2024-10-30, 04:39
Ok, so I have a JSON playlist I am loading in a plugin, which has the correct info I need available:
When my plugin is called in one mode (
What I want to happen is all that useful info to be provided to the player...I believe the idea was to use
I have tried all manner of both set_info and InfoTagVideo, and am currently using https://github.com/jurialmunkey/script.m...infotagger to do this:
Once the item is actually playing, I have a listener to
... i..e none of that data is actually getting to the player, it seems....but it should, right? Or am I misunderstanding things here?
I note that when I playback from a visible playlist (as opposed to the
So...ultimately the question is why does this not work with my dynamically created list item? (I tried setting the
Help much appreciated - I've done several scripts, some even fairly complex ones, but I am new to plugins and am quite confused at this point...
json:
{
"file": "C:\\Kodi\\Kodi Library\\TV01\\Celebrity Letters and Numbers\\Season 01\\Celebrity_Letters_And_Numbers - S01E01 - 720p WEBDL.mp4",
"type": "episode",
"source": "Kodi Library",
"dbid": 7,
"title": "Episode 1",
"thumbnail": "http://thetvdb.com/banners/v4/series/410533/backgrounds/615baa38ca034.jpg",
"fanart": "http://thetvdb.com/banners/v4/series/410533/backgrounds/615baa38ca034.jpg",
"year": 2021,
"showtitle": "Celebrity Letters and Numbers",
"season": 1,
"episode": 1,
"resumetime": 47.176,
"totaltime": 2981.4,
"artist": "",
"album": "",
"duration": 0
},
When my plugin is called in one mode (
<z mod="ctrl">PlayMedia(plugin://script.switchback/?mode=play_previous,resume)</z>
) - it loads that json and builds an (offscreen) listitem, before it sets the resolved URL to trigger playback (xbmcplugin.setResolvedUrl(plugin_instance, True, list_item)
). That works, and playback begins.What I want to happen is all that useful info to be provided to the player...I believe the idea was to use
set_info
to do this, and is now to instead use InfoTagVideo
- is that right?I have tried all manner of both set_info and InfoTagVideo, and am currently using https://github.com/jurialmunkey/script.m...infotagger to do this:
python:
list_item = xbmcgui.ListItem(label=label, path=playback.file, offscreen=offscreen)
tag = ListItemInfoTag(list_item, 'video')
infolabels = {
'mediatype': playback.type,
'dbid': playback.dbid,
'title': playback.title,
'year': playback.year,
'tvshowtitle': playback.showtitle,
'episode': playback.episode,
'season': playback.season,
'duration': playback.totaltime,
}
# list_item.setInfo("video", infolabels)
tag.set_info(infolabels)
# Auto resumes just won't work without these, even though they are deprecated...
list_item.setPath(path=playback.file)
list_item.setArt({"thumbnail": playback.thumbnail})
list_item.setProperty('TotalTime', str(playback.totaltime))
list_item.setProperty('ResumeTime', str(playback.resumetime))
list_item.setProperty('StartOffset', str(playback.resumetime))
list_item.setProperty('IsPlayable', 'true')
list_item.setArt({"poster": playback.thumbnail})
list_item.setArt({"fanart": playback.fanart})
Once the item is actually playing, I have a listener to
onAVStarted
which waits a couple of seconds then calls the JSON RPC Player.GetItem
- but no matter what data I provide in either the tag or info labels, it always comes back with:Code:
2024-10-30 13:07:56.432 T:14240 debug <general>: ### Switchback 0.0.1: KODI JSON RPC result: {"id":"Player.GetItem","jsonrpc":"2.0","result":{"item":{"episode":-1,"fanart":"image://http%3a%2f%2fthetvdb.com%2fbanners%2fv4%2fseries%2f410533%2fbackgrounds%2f615baa38ca034.jpg/","label":"Celebrity Letters and Numbers (1x01) - Episode 1","season":-1,"showtitle":"","thumbnail":"","title":"","type":"unknown","year":0}}}
... i..e none of that data is actually getting to the player, it seems....but it should, right? Or am I misunderstanding things here?
I note that when I playback from a visible playlist (as opposed to the
PlayMedia
command) - then it does in fact seem like the info is getting through:Code:
2024-10-30 13:31:41.173 T:27608 debug <general>: ### Switchback 0.0.1: KODI JSON RPC result: {"id":"Player.GetItem","jsonrpc":"2.0","result":{"item":{"episode":1,"fanart":"image://http%3a%2f%2fthetvdb.com%2fbanners%2fv4%2fseries%2f410533%2fbackgrounds%2f615baa38ca034.jpg/","id":7,"label":"Episode 1","season":1,"showtitle":"Celebrity Letters and Numbers","thumbnail":"image://video@C%3a%5cKodi%5cKodi%20Library%5cTV01%5cCelebrity%20Letters%20and%20Numbers%5cSeason%2001%5cCelebrity_Letters_And_Numbers%20-%20S01E01%20-%20720p%20WEBDL.mp4/","title":"Episode 1","type":"episode","year":2021}}}
So...ultimately the question is why does this not work with my dynamically created list item? (I tried setting the
offscreen
parameter to false, no change) ... and can I fix this?Help much appreciated - I've done several scripts, some even fairly complex ones, but I am new to plugins and am quite confused at this point...