So I submitted a new Matrix addon via P
R 3789 and got a comment about the older infolabels method being deprecated in v20. This new Matrix addon is actually an abandoned older addon I am helping get into Matrix. Here's the current section of code:
liz = xbmcgui.ListItem(name)
infolabels={ "Title": name,
"Aired": aired_text,
"Year": aired_text.split('-',1)[0],
"mediatype": 'episode',
"Duration": duration,
"Plot": plot_text }
liz.setInfo( "video", infolabels)
I thought I followed the new format properly above and tried this for the new method from the
PR 19459 request sample code itself:
liz = xbmcgui.ListItem(name)
videoInfoTag = liz.getVideoInfoTag()
videoInfoTag.setFirstAired(aired_text)
videoInfoTag.setYear(year_text)
videoInfoTag.setMediaType('episode')
videoInfoTag.setDuration(duration)
videoInfoTag.setPlot(plot_text)
However I get the following error on Kodi 19.1:
2021-11-20 21:21:12.876 T:34252 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: 'xbmc.InfoTagVideo' object has no attribute 'setFirstAired'
Traceback (most recent call last):
File "C:\Users\Audio1\AppData\Roaming\Kodi\addons\plugin.video.cbc-sports\addon.py", line 423, in <module>
INDEX(url)
File "C:\Users\Audio1\AppData\Roaming\Kodi\addons\plugin.video.cbc-sports\addon.py", line 110, in INDEX
addDir2(title, url, iduration, 2, image)
File "C:\Users\Audio1\AppData\Roaming\Kodi\addons\plugin.video.cbc-sports\addon.py", line 364, in addDir2
videoInfoTag.setFirstAired(aired_text)
AttributeError: 'xbmc.InfoTagVideo' object has no attribute 'setFirstAired'
-->End of Python script error report<--
Is this new format not implemented yet in Kodi or am I doing something wrong for the new format ? I wasn't able to find any working examples yet in the Kodi repo.
Jeff