Skip to content

Commit

Permalink
Merge pull request #7 from dersphere/viewmode
Browse files Browse the repository at this point in the history
add possibility to set the view_mode via "plugin.add_items(items, view_mode)"
  • Loading branch information
jbeluch committed Apr 11, 2012
2 parents b6a3938 + 048df83 commit b2f7454
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/xbmcswift/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
xbmcplugin.endOfDirectory(self.handle)

return urls
Expand Down

0 comments on commit b2f7454

Please sign in to comment.