Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
v20 ListItem.setInfo() to InfoTagVideo migration discussion
#1
I am hoping to get a developer discussion going around how folks are thinking about handling the migration from ListItem.setInfo() to InfoTagVideo and similar calls (i.e. ListItem.setProperty(), ListItem.addStreamInfo() etc..).  I started testing with the Nexus Alpha 2 release for a video addon and the logs are full of the deprecation notice.  There have been prior discussions regarding this migration happening.  For some addons there could be quite a bit of code changes to handle the migration.

My first main question is whether folks are thinking of creating a new release for their addons for Nexus or try to maintain a common code release between Matrix and Nexus and detect the version number to determine whether to use ListItem.setInfo() or InfoTagVideo ?  Or just let it go for now and ignore the log messages and deal with it in the future when it gets closer to ListItem.setInfo() support being dropped. 

I can see the amount of deprecation messages in many video addons causing more work for debugging.  I am leaning towards separate Matrix and Nexus releases of my addons in the future and maybe starting on one now to see if I find any issues with InfoTagVideo.

Thoughts ?


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
#2
Personally, I don't like many version conditionals so I guess I'll wait until deprecation will become eminent and just do the move and start the new minimally supported version.
Reply
#3
For the TMDb TV Shows scraper I just did a Nexus only version.  It's a bit of a pain back porting changes right now, but once Nexus comes out I'll only be doing break/fix support for the Matrix version anyway.

I tried the conditional logic route, but the difference between setting on the ListItem to setting on the VideoTag are significant enough that it's not just one line you're changing.  Sometimes I had to rethink what I was passing around.  Once I did that it was easier to have a separate version.
Reply
#4
(2022-08-14, 12:47)pkscout Wrote: For the TMDb TV Shows scraper I just did a Nexus only version.  It's a bit of a pain back porting changes right now, but once Nexus comes out I'll only be doing break/fix support for the Matrix version anyway.

I tried the conditional logic route, but the difference between setting on the ListItem to setting on the VideoTag are significant enough that it's not just one line you're changing.  Sometimes I had to rethink what I was passing around.  Once I did that it was easier to have a separate version.

I've been looking at the same issues.  Right now, for my largest addon I maintain 100% feature parity on two versions between Kodi 18 and 19.  I agree this setinfo change is more than a couple of lines of code to change and there isn't backwards compatibility between Python 3/2 or   InfoTagVideo / setinfo so I'd be looking at maintaining 3 versions to maintain feature parity.  There is the option to eventually force folks to upgrade by not maintaining feature parity then I'd have to maintain a list of features by version. 

One thing I am interested in with the InfoTagVideo migration is performance differences.  It really isn't a big deal with my main addon and I maintain performance stats on how fast listitems process / display so I am curious if there is a measurable improvement, as predicted in other threads.  I may mock up a conditional version so I can test performance differences between the two methods in Nexus.  The mock up will also give me some idea of how complicated the conditional logic approach could be.  I am still leaning towards a separate release and may pause feature parity with Kodi 18.




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
#5
(2022-08-14, 15:18)jbinkley60 Wrote: One thing I am interested in with the InfoTagVideo migration is performance differences. 
Looking through the Github issue on this, the performance increase is suppose to be noticeable, as it was the main point of the rework.  I timed a few TV show scrapes in Matrix using the older methods and Nexus with the newer ones, and it does appear to be faster, but not orders of magnitude faster.  Mostly what I saw was cutting maybe 10 seconds off a scrape of The Simpsons (which can be a dossey of a scrape given the number of episodes).  What I can't say is whether any of that is due to other Nexus changes.  Worse, since Nexus is still in Alpha, it's possible that the Alpha code is actually slowing things down in unrelated ways, so it's a little hard to say right now what difference we'll see in practice with the scraper.
Reply
#6
I started playing with this a little today on some simple folder level listitems that don't have a lot of metadata to set.  One thing which is a little confusing is the serArt functionality.

listItem.setArt({'banner': icon, 'poster': icon, 'icon': icon, 'fanart': addon_fanart})

I am not getting deprecation messages so it appears this is not on the deprecation list yet.  Also when I look at the InfoTagVideo page I see an AddAvailableArtwork method, which looks close but doesn't pass a dictionary so if this is the replacement for setArt then does it need to be called multiple times, once for each artwork type ?   I don't see a setArt method in InfoTagVideo, like for most everything else.


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
#7
(2022-08-13, 16:05)jbinkley60 Wrote: My first main question is whether folks are thinking of creating a new release for their addons for Nexus or try to maintain a common code release between Matrix and Nexus and detect the version number to determine whether to use ListItem.setInfo() or InfoTagVideo ?  Or just let it go for now and ignore the log messages and deal with it in the future when it gets closer to ListItem.setInfo() support being dropped. 

I can see the amount of deprecation messages in many video addons causing more work for debugging.  I am leaning towards separate Matrix and Nexus releases of my addons in the future and maybe starting on one now to see if I find any issues with InfoTagVideo.

I am maintaining an orphaned addon (extendedinfo , unfortunately can't get the pr into official Kodi repo) that relies on a module kutils.  That module is driving me nuts in Nexus due to "deprecated" logging.  So I did my own update on it using version test so it is Matrix/Nexus compatible.  I guess I don't see the benefit of not passing a dict to Kodi but I can go with the flow on this.  Also applies to streamdetails.

scott s.
.
Reply
#8
I have a question, where the answer is probably very obvious but alluding me for some reason.  I am trying to create some conditional logic but am missing how to associate xbmc.InfoTagVideo to my listitem to update information.  Here's some of the code:


                li = xbmcgui.ListItem(title)

                    if int(installed_version) == 19:   
                        li.setProperty('ResumeTime', dcmInfo_text)
                        li.setProperty('TotalTime', str(durationsecs))
                    else:
                        vinfo = xbmc.InfoTagVideo(offscreen=False)
                        vinfo.setResumePoint(float(dcmInfo_text), durationsecs)

                 xbmcplugin.addDirectoryItem(handle=addon_handle, url=itemurl, listitem=li, isFolder=False)


I can't find any examples of updating an xbmcgui.ListItem with an xbmc.InfoTagVideo.  What am I missing to associate the two ?  When I run this under Nexus the resume point doesn't get set.


Thanks,

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
#9
(2022-08-15, 10:53)jbinkley60 Wrote: I can't find any examples of updating an xbmcgui.ListItem with an xbmc.InfoTagVideo.  What am I missing to associate the two ?  When I run this under Nexus the resume point doesn't get set.

After some trial and error and poking around I figured it out:

                li = xbmcgui.ListItem(title)

                    if int(installed_version) == 19:   
                        li.setProperty('ResumeTime', dcmInfo_text)
                        li.setProperty('TotalTime', str(durationsecs))
                    else:
                        vinfo = li.getVideoInfoTag()
                        vinfo.setResumePoint(float(dcmInfo_text), durationsecs)

                 xbmcplugin.addDirectoryItem(handle=addon_handle, url=itemurl, listitem=li, isFolder=False)

I needed to get the listitem tag vs. trying to creating a new one for the listitem.  The documentation is a bit obscure on that topic.


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
#10
I've completed some conditional logic except for setting the cast and did some performance comparison timings rendering lists.  All testing was done under Nexus and I just changed the method between the old and new methods (setinfo and infoTagVideo).  Here's some initial results based upon the average of 3 consecutive tests of each playlist:


Items             Method              Kodi Time             List type
100              infoTagVideo                  .19s                 Individual items
100              setInfo                              .21s                 Individual items
300              infoTagVideo                  .26s                 Individual items
300              setInfo                              .33s                 Individual items
296             infoTagVideo                   .30s                 Folders and Individual items
296              setInfo                              .40s                 Folders and Individual items

So I am seeing anywhere from 10-25% improvement on the time Kodi takes to process the items for displaying.  This is pretty good, albeit unlikely to be noticeable.  This testing was done under Wwindows on a PC.  It will be more interesting testing on lower powered devices and larger lists.  What makes this a little more interesting is that with the new infoTagVideo method I had to do more processing of the source data due to the differences in data types.  For instance a number of the fields in the setInfo method were strings whereas in the infoTagVideo method they are lists.  So I had to incorporate more checking for empty strings and using the split method to convert from string to lists for infoTagVideo. 

For example:

if genre_text is not None: vinfo.setGenres(genre_text.split(','))
if writer_text is not None: vinfo.setWriters(writer_text.split(','))

in setInfo these and other metadata fields are string or list fields.  They need to be lists for infoTag Video.  


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
#11
I've completed conditional coding for all three uPNP media types, pictures, music and videos. One thing I found is a discrepancy between the setPlaycount method for infoTagMusic and infoTagVideo.  For infoTagVideo it is   setPlaycount but for infoTagMusic it is  setPlayCount.



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
#12
(2022-08-14, 20:43)jbinkley60 Wrote: I started playing with this a little today on some simple folder level listitems that don't have a lot of metadata to set.  One thing which is a little confusing is the serArt functionality.

listItem.setArt({'banner': icon, 'poster': icon, 'icon': icon, 'fanart': addon_fanart})

I am not getting deprecation messages so it appears this is not on the deprecation list yet.  Also when I look at the InfoTagVideo page I see an AddAvailableArtwork method, which looks close but doesn't pass a dictionary so if this is the replacement for setArt then does it need to be called multiple times, once for each artwork type ?   I don't see a setArt method in InfoTagVideo, like for most everything else.


Jeff
The setArt functionality didn't change.  I asked about that at one point, and changing the art stuff is a much larger project that will have to be done later.  So you still have to set art on the listItem and everything else on the InfoTag.
Reply
#13
(2022-08-17, 23:59)pkscout Wrote: The setArt functionality didn't change.  I asked about that at one point, and changing the art stuff is a much larger project that will have to be done later.  So you still have to set art on the listItem and everything else on the InfoTag.

Thanks.  That confirms what I am seeing with regards to setArt.  Writing the overall conditional logic and creating the new formats wasn't too bad once I got past a couple of things like data type conversions and checking for empty strings.  I can reuse most of the code elsewhere just by changing the variable names. 

I did find an issue where the alpha 2 code isn't handling all of the setInfo method metadata for music.  I haven't fully debugged it yet to see what all is missing.  It works fine with the new method but most addons day 1 will still be using the setInfo method.


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
#14
After a week of messing with this I am going to answer my own question.  I've decided to go with conditional logic for now because I am still supporting a Kodi 18 version and didn't want to try and maintain 3 versions of code for Kodi 18, 19 and 20.  As @pkscout mentioned though, it is more than a single line of code change.  There was  a bit of change  for me with my largest addon where I have 3 main lisitem setinfo functions but all three are somewhat similar, with 2 of them being pretty much identical.  However each function does cover 3 media types (i.e. video, music and photo) and the multiple media types do complicate things a bit but this does look like a one time thing where I don't expect to be touching the listiem code much in the future.   It is far more likely that I will be touching other areas of the addon code more in the future, which is where maintaining a third version of the addon lost out.  It's hard enough maintaining two versions. 

Have most folks stopped support for v18 / Python 2 and prior addons, except maybe for bug fixes ?  I need to decide when I will stop with the feature parity for Python 2 based addons.  I feel that time is near.


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
#15
(2022-08-21, 11:08)jbinkley60 Wrote: Have most folks stopped support for v18 / Python 2 and prior addons, except maybe for bug fixes ?  I need to decide when I will stop with the feature parity for Python 2 based addons.  I feel that time is near.
I personally generally do current, previous, next support.  So in theory right now that means Matrix (19), Leia (18), Nexus (20).  But the change from Python2 to Python3 from Leia to Matrix was a big one, so I've mostly stopped doing Leia support unless it's a huge break that needs fixing.  And I'm definitely not doing feature updates for Leia.

At this point Matrix was released almost a year and a half ago.  I know not *every* add-on was ported to Matrix, but most were.  So unless you have one of those add-ons that isn't available *and* it is critical to how you use Kodi, I mostly tell people on Leia that they need to update.

If I remember correctly the Kodi Team does current, next.
Reply

Logout Mark Read Team Forum Stats Members Help
ListItem.setInfo() to InfoTagVideo migration discussion0