MoojMidge / service.upnext

GNU General Public License v2.0
19 stars 5 forks source link

Kodi 20 compatibility #8

Closed notoco closed 1 year ago

notoco commented 1 year ago

I ran kodi 20 today as a test and the add-on has some problem in the logs (it works but throws warnings)

2022-11-14 03:35:14.987 T:7616  warning <general>: "resumetime" in ListItem.setProperty() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setResumePoint().
2022-11-14 03:35:14.987 T:7616  warning <general>: "totaltime" in ListItem.setProperty() is deprecated and might be removed in future Kodi versions. Please use InfoTagVideo.setResumePoint().
2022-11-14 03:35:14.990 T:7616  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.

https://github.com/MoojMidge/service.upnext/blob/master/resources/lib/upnext.py#L110 - I guess it's in these lines.

MoojMidge commented 1 year ago

I was planning on adding a couple more widget sources, will have a look at it then. The changes required in Nexus, to use individual InfoTagVideo setters, are not backwards compatible, and are a bit tedious to implement tbh. Almost a classic case of design by committee. I suspect many plugins won't be updated until forced to when the deprecated ListItem methods are removed in Kodi v21 or later.

notoco commented 1 year ago

The fact that the changes are not compatible is one thing - but the logs grow terribly fast, especially with devices that are turned on 24 hours a day. Take a look at this - CastagnaIT solved this problem completely differently: https://github.com/CastagnaIT/plugin.video.netflix/blob/master/resources/lib/common/kodi_wrappers.py

MoojMidge commented 1 year ago

the logs grow terribly fast, especially with devices that are turned on 24 hours a day

Nexus hasn't been released yet, but when it does I suspect a large number of plugins will be triggering this flood of log messages.

CastagnaIT solved this problem completely differently:

There are many ways to skin a cat, but not many that aren't messy.

When I say the changes aren't backwards compatible, that doesn't mean that plugins can't be changed to work in both Matrix (and older versions) and Nexus, it just means that either there needs to be two different code paths to do the same thing, a single larger and slower code path that manages both, or a way to translate the old video info data to be used with the new setters as CastagnaIT has done.

The latter approach has less maintenance requirements, but the specific way CastagnaIT has done it appears to be influenced by the need to store and pickle the video info data.

I am aware of the issue and other Nexus specific changes such as the settings format, but all things in good time.

notoco commented 1 year ago

Yes - a few add-ons that are used by me send so many warnings in the logs that I'm afraid. So we are waiting for the next transitions like with k18->k19 and python - many add-ons in two different versions....

MoojMidge commented 1 year ago

Fixed in master

So we are waiting for the next transitions like with k18->k19 and python - many add-ons in two different versions....

Shouldn't be anywhere near as big a change, there will just lots of log spam until plugins get updated. Or maybe enough people will complain that a Nexus point release will reduces the log messages.