Browse files

added possibility to set the view_mode via "plugin.add_items(items, v…


Can be used to set the folder listing to a given view by its id. video_mode=500 is thumbnail view.
This is just an example - feel free to refuse or implement in a different way.
  • Loading branch information...
1 parent b6a3938 commit 048df83cf570be3d6a0b54a34f339bbbfa14faf6 @dersphere committed Oct 23, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/xbmcswift/
@@ -190,7 +190,7 @@ def _make_listitem(self, label, label2='', iconImage='', thumbnail='',
#return li
return options['url'], li, options.get('is_folder', True)
- def add_items(self, iterable):
+ def add_items(self, iterable, view_mode=None):
# If we are in debug mode, do not make the call to xbmc
# for each item
# if in debug mode, print it to command line
@@ -217,6 +217,8 @@ def add_items(self, iterable):
if self._mode is 'xbmc':
if not xbmcplugin.addDirectoryItems(self.handle, items, len(items)):
raise Exception, 'problem?'
+ if view_mode:
+ xbmc.executebuiltin('Container.SetViewMode(%s)' % view_mode)
return urls

0 comments on commit 048df83

Please sign in to comment.