2015-07-26, 23:09
Can I get the DBID from a Python xbmcgui.ListItem?
The new context menu item add-ons in Isengard pass along the selected item as sys.listitem, and I need to get the DBID from that, what skins access as 'ListItem.DBID'. I've looked through the docs and wiki and haven't found what I need, but Kodi has a lot of hidden nooks and crannies and I'm hoping I just missed it.
xbmc.getInfoLabel('ListItem.DBID') works sometimes, but not reliably: seemingly always accurate for movies, usually accurate for TV shows, but occasionally picks a random show (which is the killer for me), and for episodes it always seems to pick the first item in the list ('..'/1st episode/etc). I'm unsure about music videos. The docs do say to use sys.listitem, so it's not really a bug, but it sure is unfortunate because that's exactly what I need.
The new context menu item add-ons in Isengard pass along the selected item as sys.listitem, and I need to get the DBID from that, what skins access as 'ListItem.DBID'. I've looked through the docs and wiki and haven't found what I need, but Kodi has a lot of hidden nooks and crannies and I'm hoping I just missed it.
xbmc.getInfoLabel('ListItem.DBID') works sometimes, but not reliably: seemingly always accurate for movies, usually accurate for TV shows, but occasionally picks a random show (which is the killer for me), and for episodes it always seems to pick the first item in the list ('..'/1st episode/etc). I'm unsure about music videos. The docs do say to use sys.listitem, so it's not really a bug, but it sure is unfortunate because that's exactly what I need.