Changes to the python API for Kodi Krypton

  Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
phil65 Offline
Team-Kodi Developer
Posts: 6,687
Joined: Mar 2009
Reputation: 147
Location: Cologne, Germany
Post: #16
2016-04-11 New method contextmenu() for xbmcgui.Dialog()

added a new method to xbmcgui.Dialog():
  • xbmcgui.Dialog().contextmenu(list=["option1", "option2"])

returns position of selected item, or -1 if cancelled

pull request: https://github.com/xbmc/xbmc/pull/9591

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
(This post was last modified: 2016-04-11 19:36 by phil65.)
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #17
2016-04-14 removed option - replaceItems

xbmcgui.ListItem().addContextMenuItems() no longer has the 'replaceItems' option.
it's no longer possible for addons to remove the default kodi context menu items.


pull request: https://github.com/xbmc/xbmc/pull/9595

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-04-19 21:58 by ronie.)
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #18
2016-04-19 New method - WindowXML().getCurrentContainerId()

added a new method to the xbmcgui.WindowXML() class
  • xbmcgui.WindowXML().getCurrentContainerId()

returns the id of the currently visible container.

pull request: https://github.com/xbmc/xbmc/pull/9627

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-05-05 22:17 by ronie.)
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #19
2016-04-19 New method - ListItem().getArt()

added a new method to the xbmcgui.ListItem() class
  • xbmcgui.ListItem().getArt('type')

allows addons to retrieve all supported artwork types from a listitem.

example:
Code:
poster = self.list.getSelectedItem().getArt('poster')

pull request: https://github.com/xbmc/xbmc/pull/9627

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-04-19 22:08 by ronie.)
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #20
2016-04-19 New option - ListItem().setInfo("dbid", xxx)

added a new option to the xbmcgui.setInfo() method
  • xbmcgui.ListItem().setInfo("dbid", xxx)

allows addons to set the kodi dbid to a listitem.
Please only use this if the item should correspond to some item in your library.
It is also needed to set the correct mediatype when making use of this new option.

pull request: https://github.com/xbmc/xbmc/pull/9627

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
(This post was last modified: 2016-04-20 01:31 by phil65.)
find quote
Martijn Offline
Team Kodi
Posts: 16,920
Joined: Jul 2011
Reputation: 310
Location: Dawn of time
Post: #21
2015 expand existing option - ListItem().setInfo(type=XXX, infoLabels={"mediatype": XXX})

Expanded existing options for xbmcgui.ListItem().setInfo() method to allow setting the mediatype of a listitem. This option already exists in v16 "Jarvis" and should not cause problems if added to any plugin before v16 so please make sure you add it.

  • xbmcgui.ListItem().setInfo("mediatype", xxx)

allows addons to set the correct mediatype of a listitem.

Available options are:
PHP Code:
""
"music"
"artist"
"album"
"song"
"video"
"set"
"musicvideo"
"movie"
"tvshow"
"season"
"episode" 

Kodi source code: https://github.com/xbmc/xbmc/blob/master....h#L28-L39
Pydocs: http://mirrors.kodi.tv/docs/python-docs/...em-setInfo
Example of plugin change: https://github.com/BigNoid/service.libra...ee02122b13

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
(This post was last modified: 2016-04-24 15:53 by phil65.)
find quote
phil65 Offline
Team-Kodi Developer
Posts: 6,687
Joined: Mar 2009
Reputation: 147
Location: Cologne, Germany
Post: #22
2016-05-02 New param: "preselect" for Dialog().multiselect() and Dialog().select()

added a new param to Dialog().multiselect() and Dialog().select():
  • ret = xbmcgui.Dialog().multiselect(items, preselect=[0,3,...])
  • ret = xbmcgui.Dialog().select(items, preselect=2)

allows items from SelectDialog to get preselected.
The param "preselect" takes a list of ints for the multiselect dialog, and a single int for the default select dialog.

pull request: https://github.com/xbmc/xbmc/pull/9666

Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
find quote
Martijn Offline
Team Kodi
Posts: 16,920
Joined: Jul 2011
Reputation: 310
Location: Dawn of time
Post: #23
2016-05-08 removed option: xbmc.Player().disableSubtitles()

PHP Code:
xbmc.Player().disableSubtitles() 
is deprecated since 2012 and now totally removed. Please use
PHP Code:
xbmc.Player().showSubtitles(false
instead.

https://github.com/xbmc/xbmc/pull/9767

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
(This post was last modified: 2016-05-08 19:48 by Martijn.)
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #24
2016-05-20 slider control - orientation support

the slider control now supports the orientation argument.

by default the orientation will be vertical
if your addons currently uses a slider, you need to add the orientation argument to keep them horizontal:
Code:
self.slider = xbmcgui.ControlSlider(100, 250, 350, 40, orientation=xbmcgui.HORIZONTAL)


pull request: https://github.com/xbmc/xbmc/pull/9704

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #25
2016-05-26 removed controls

support for some old/deprecated controls have been removed from the kodi / the xbmcgui module:
  • checkmark control
  • selectbutton control
  • multiselect control
  • largeimage control

should you still be using the largeimage control through the WindowXML class, please replace it with an image control and use<texture background="true">,
which will have the exact same effect as the largeimage control.

pull request: https://github.com/xbmc/xbmc/pull/9848

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #26
2016-06-12 move changelog to addon.xml

it's no longer possible to view the addon changelog inside kodi.
instead you can add the latest changes to your addon.xml file, using the <news> tag.

pull request: https://github.com/xbmc/xbmc/pull/9351

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #27
2016-06-20 removed window id's

these deprecated window id's have been removed from kodi
  • 10005
  • 10006
  • 10020
  • 10024
  • 10501


pull request: https://github.com/xbmc/xbmc/pull/9886

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #28
2016-04-10 changed window id's

in case your addon operates on any of the pvr related windows
  • pvrguideinfo (10600)
  • pvrrecordinginfo (10601)
  • pvrtimersetting (10602)
  • pvrgroupmanager (10603)
  • pvrchannelmanager (10604)
  • pvrguidesearch (10605)
  • pvrchannelscan (10606)
  • pvrupdateprogress (10607)
  • pvrosdchannels (10608)
  • pvrosdguide (10609)
  • pvrradiordsinfo (10610)
  • tvchannels (10700)
  • tvrecordings (10701)
  • tvguide (10702)
  • tvtimers (10703)
  • tvsearch (10704)
  • radiochannels (10705)
  • radiorecordings (10706)
  • radioguide (10707)
  • radiotimers (10708)
  • radiosearch (10709)
  • tvtimerrules (10710)
  • radiotimerrules (10711)


pull request: https://github.com/xbmc/xbmc/pull/9584

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #29
2016-07-16 Addon.xml - assets tag

addons can add an <assets> tag to the xbmc.addon.metadata section in your addon.xml file.
inside the assets tag, you should specify the path to the icon.png, fanart.jpg and screenshot files (screenshots aren't mandatory).
this means icon & fanart don't have to be placed at the root of your addon anymore.

Code:
    <extension point="xbmc.addon.metadata">
        <summary lang="en_GB">Best addon in the world!!!1!</summary>
        ...
        <assets>
            <icon>resources/icon.png</icon>
            <fanart>resources/fanart.jpg</fanart>
            <screenshot>resources/screenshot-01.jpg</screenshot>
            <screenshot>resources/screenshot-02.jpg</screenshot>
            <screenshot>resources/screenshot-03.jpg</screenshot>
            <screenshot>resources/screenshot-04.jpg</screenshot>
            <screenshot>resources/screenshot-05.jpg</screenshot>
            <screenshot>resources/screenshot-06.jpg</screenshot>
            <screenshot>resources/screenshot-07.jpg</screenshot>
            <screenshot>resources/screenshot-08.jpg</screenshot>
            <screenshot>resources/screenshot-09.jpg</screenshot>
            <screenshot>resources/screenshot-10.jpg</screenshot>
            <screenshot>resources/screenshot-11.jpg</screenshot>
            <screenshot>resources/screenshot-12.jpg</screenshot>
        </assets>
</extension>

git commit: https://github.com/xbmc/xbmc/commit/d071...67283fb707
pull request: https://github.com/xbmc/xbmc/pull/10060

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ronie Offline
Team-Kodi Member
Posts: 13,166
Joined: Jan 2009
Reputation: 391
Post: #30
2016-09-23 icon.png

if you (plan to) submit your addon to the kodi repo,
the max. resolution for your addon icon.png is now 512x512px.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote