(2022-12-30, 03:33)gujal Wrote: @host505 @scott967
Thanks for the pointers and sample code from host505, I have now got rid of the below message in the logs
Code:
warning <general>: ListItem.setCast() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setCast().
Those messages were being logged for each item in the list so log was full of them.
Now I have to figure out which infolabel is logging this message and have to fix it (though it is only on message per list)
Code:
warning <general>: Setting most video properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagVideo.
Is Listitem.setInfo() not advisable at all in Kodi 20?
Here's a
developer thread on this topic. Listitem.setInfo() is still supported in Kodi 20 but the deprecation message is telling you that it may be eliminated in the future. If you want to get rid of those deprecation messages the choice will be to write a Kodi 20+ version of the addion or determine the version number in a common version of the addon and then do either a InfoTagVideo setter approach when running under Kodi 20 or a ListItem.setInfo() when running on Kodi 19. As you can tell from the thread I attached, I went the detect version approach.
Here's a code snippet:
def get_installedversion():
# retrieve current installed version
json_query = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "method": "Application.GetProperties", "params": {"properties": ["version", "name"]}, "id": 1 }')
json_query = json.loads(json_query)
version_installed = []
if 'result' in json_query and 'version' in json_query['result']:
version_installed = json_query['result']['version']['major']
return str(version_installed)
installed_version = get_installedversion()
mediaClass_text = 'video'
if installed_version == '19':
info = {
'title': title,
.....
)
li.setInfo(mediaClass_text, info)
else:
vinfo = li.getVideoInfoTag()
vinfo.setTitle(title)
.........
I can help you with specific InfoTagVideo setters.
Thanks,
Jeff