Posts: 247
Joined: Oct 2011
Reputation:
11
Also how can I create a ListItem in offscreen=True mode
I tryed the following:
list = xbmcgui.ListItem(listItemName, iconImage=thumbPath, thumbnailImage=thumbPath, offscreen=True)
But I get this error
TypeError: 'offscreen' is an invalid keyword argument for this function
Posts: 247
Joined: Oct 2011
Reputation:
11
thank for confirming that.
You mentioned Python based scrappers.
The addon I am working on goes out to a media server and gets a list of movies from a web api and then builds ListItems to show these movies in Kodi. Would this be considered a scrapper?
Posts: 15,282
Joined: Jan 2009
Reputation:
738
ronie
Team-Kodi Member
Posts: 15,282
nope, i was referring to our metadata scrapers... the one you use when you scan your media to the library.
Posts: 247
Joined: Oct 2011
Reputation:
11
I just had a play with OSMC Kodi 18 and the offscreen=True option, when creating ListItem objects this significantly speeds up creating many items 200+ for display.
Initial tests went from 15 seconds to load and create 450 items down to about 2 seconds on my test RPi2 with just one line change.
Posts: 15,282
Joined: Jan 2009
Reputation:
738
ronie
Team-Kodi Member
Posts: 15,282
as you can read in the commit you linked to, offscreen should only be set to True for listitems that are not going to be displayed ;-)
Posts: 247
Joined: Oct 2011
Reputation:
11
2017-02-19, 02:20
(This post was last modified: 2017-02-19, 02:22 by null_pointer.)
not on the screen now or never going to be on the screen?
From what I can see in the source if you are building this item to be eventually shown on the screen that should be ok.
Posts: 247
Joined: Oct 2011
Reputation:
11
why is this?
If the ListItem is not on the screen currently why does it need a GUI lock when you set data in it?
Posts: 15,282
Joined: Jan 2009
Reputation:
738
ronie
Team-Kodi Member
Posts: 15,282
if i could give an accurate answer i would :-)
perhaps someone with a better understanding of GUI locking can chime in?
Posts: 247
Joined: Oct 2011
Reputation:
11
I would like to go deeper on this and find out if this is a valid use of the offscreen param.
If I can create a bunch of ListItems offscreen and then return them in the addon it can speed it up by a factor of 10.
If this is not valid and might stop working in a future update then I wont bother.
Anyone care to comment?
Posts: 1,506
Joined: Nov 2013
That is the intended use. The gui is uselessly locked in most cases. as long as the item do not sit in a onscreen container this should be set. I just couldnt change the default as that would break legacy code depending on it.
History is that originally listitems were always backed by a container item but the bindings are now used for much more than building windows. It made sense a long time ago.
Posts: 247
Joined: Oct 2011
Reputation:
11
excellent, thanks for confirming.
any change of getting this pull request into 17.1?