Changes to the python API (and addon structure) for Kodi Matrix (v19)
#16
I think the best source of info is the original PR: https://github.com/xbmc/xbmc/pull/19459#...-806450382
Reply
#17
So I submitted a new Matrix addon via PR 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
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#18
SetFirstAired is v20 onwards.  I don't think any of that was backported to v19 as it's not a fix for an issue.
Learning Linux the hard way !!
Reply
#19
(2021-11-21, 13:57)black_eagle Wrote: SetFirstAired is v20 onwards.  I don't think any of that was backported to v19 as it's not a fix for an issue.

Thanks.  That was my thought.  So the comment in the PR request was for awareness vs,. me needing to fix anything.  I suspect the deprecation period for this old method is going to have to last quite some time.  There are a lot of addons which will need updated vs. having them break if the old functionality is suddenly not supported.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#20
(2021-11-21, 14:10)jbinkley60 Wrote: I suspect the deprecation period for this old method is going to have to last quite some time.

I think what usually happens is that when the team deprecate something in a version, both methods continue to work in that version and then the deprecated stuff is removed in the following version.  So something being deprecated in v20 will continue to work (although there should be log notifications regarding it) and then be removed in v21.  No eta for either of those but I'd guess not any time soon!
Learning Linux the hard way !!
Reply
#21
@enen92
Does a listing of the Python API (and add-on structure) changes for Kodi Nexus (v20) and Omega (v21) exist somewhere? Maybe on doxygen?
Reply
#22
https://xbmc.github.io/docs.kodi.tv/mast...sions.html

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Changes to the python API (and addon structure) for Kodi Matrix (v19)0
This forum uses Lukasz Tkacz MyBB addons.