Kodi Community Forum

Full Version: Changes to the python API (and addon structure) for Kodi Matrix (v19)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Below you'll find an up-to-date list of all changes made to the python API since the release of Kodi Leia.

List of changes so far:

Removed strings.xml support
monitor.onDatabaseUpdated and monitor.onDatabaseScanStarted removed
xbmc.python was bumped to version 3.0.0


previous threads:
Changes to the python API for Kodi Leia
23-05-2019 - Removed strings.xml support (PR)

Kodi Matrix no longer supports the long deprecated strings.xml format. All addons must comply to the strings.po format. See https://kodi.wiki/view/Language_support#...strings.po
Thanks. There is an error in the wiki. Currently the wiki shows in the example
Code:
#empty string with id 32003
But if I use it that way, Travis gives a syntax error on the strings.po when submitting the files
Travis only accepts when there is a space after the hash as follows
Code:
# empty string with id 32003
thx, corrected
03-06-2019 - xbmc.Monitor().onDatabaseUpdated() and xbmc.Monitor().onDatabaseScanStarted() were removed  (PR)

Both monitor class methods were deprecated since Helix in favor of onScanStarted() and onScanFinished(). Any uses of the deprecated methods should be adjusted to the current counterparts.
21-10-2019 - xbmc.python was bumped to version 3.0.0  (PR)

If you plan to submit on addon to the addon repo for kodi matrix, please set xbmc.python to 3.0.0
23-03-2020 Removal of deprecated features (PR)

Removed
xbmc.monitor().onAbortRequested()

xbmcgui.DialogBusy()
xbmcgui.DialogBusy().create()
xbmcgui.DialogBusy().update()
xbmcgui.DialogBusy().iscanceled()

xbmcgui.ListItem().setIconImage()
xbmcgui.ListItem().setThumbnailImage()
xbmcgui.ListItem().getdescription()
xbmcgui.ListItem().getduration()
xbmcgui.ListItem().getfilename()

xbmcgui.Window().getResolution()
xbmcgui.Window().setCoordinateResolution()

Changed Method parameters - Removed

ControlEdit - removed isPassword
ControlRadioButton - removed focusTexture, noFocusTexture

xbmcgui.Dialog().yesno() - Removed Line2, Line3
xbmcgui.Dialog().cancel() - Removed Line2, Line3
xbmcgui.Dialog().ok() - Removed Line2, Line3

xbmcgui.DialogProgress().create() - Removed Line2, Line3
xbmcgui.DialogProgress().update() - Removed Line2, Line3

xbmcgui.ListItem() - Removed iconImage, thumbnailimage
23-03-2020 xbmcgui.Dialog().yesno() - add support for custom button
besides the 'yes' and 'no' buttons, a third 'custom' button is now available.

https://github.com/xbmc/xbmc/pull/17494
2020-03-16 Changed built-in commands

not a python api change, but it might affect addons as well:
the use of an XBMC. prefix for built-in commands is no longer supported.

for example, this is no longer supported:
python:
xbmc.executebuiltin('XBMC.ActivateWindow(Videos)')
you'll have to use this instead:
python:
xbmc.executebuiltin('ActivateWindow(Videos)')

pull-request: https://github.com/xbmc/xbmc/pull/17457
commit: https://github.com/xbmc/xbmc/commit/3b35...b7736704fb
Recently Kodi 19 moved to using spdlog in its core. This meant a cleanup of the log levels kodi has had for many years. The xbmc.LOGNOTICE level is now redundant and xbmc.LOGINFO should now be used instread. Kodi will then use the following set of levels for logging: DEBUG, INFO, WARNING, ERROR and FATAL. The deprecated log levels have all been changed in Kodi code in this PR: https://github.com/xbmc/xbmc/pull/17730.The xbmc.LOGNOTICE level will deprecated from all APIs by the end of June.

Forum post: https://forum.kodi.tv/showthread.php?tid...pid2943669
24 April 2020 - xbmc.makeLegalFilename() was moved to the xbmcvfs module (xbmcvfs.makeLegalFilename())

Method was using arguments still from the xbox days, and is a vfs related method. Documentation was also improved: https://codedocs.xyz/xbmc/xbmc/group__py...918cd40491

PR: https://github.com/xbmc/xbmc/pull/17735
13 May 2020 -  xbmc.abortRequested flag was removed completely.

This old flag was used to notify any scripts (injected in the path before loading any script) that abort was requested from kodi. It was deprecated for a long time and was not even documented in the python API. If your addon uses such flag, please adjust your addon to use a monitor instance instead: xbmc.Monitor().abortRequested()

PR: https://github.com/xbmc/xbmc/pull/17789
25 April 2020 - xbmc.validatePath() was moved to the xbmcvfs module (xbmcvfs.validatePath())

As this method is a vfs related method, it has been moved to the xbmcvfs module.

PR: https://github.com/xbmc/xbmc/pull/17750
01 September 2020 - xbmc.translatePath() was moved to the xbmcvfs module (xbmcvfs.translatePath())

As this method is a vfs related method, it has been moved to the xbmcvfs module.

xbmc.translatePath() is now deprecated, it still works but will be removed in the future.
please update your code!

PR: https://github.com/xbmc/xbmc/pull/18345
Quote:Setting most video properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagVideo.

How should I use InfoTagVideo? Can't find any info about his changes. This is how my code looks like:
python:
ListItem.setInfo( type="Video", infoLabels={ "Title": channelInfo.title, } )
Pages: 1 2