Ejemplo n.º 1
0
    def add_items(self, iterable, is_update=False, sort_method_ids=[],
                  override_view_mode=False):
        items = []
        urls = []
        for i, li_info in enumerate(iterable):
            
            items.append( 
                self._make_listitem(**li_info)
            )

            if self._mode in ['crawl', 'interactive']:
                print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
                                            '', li_info.get('url'))
                urls.append(li_info.get('url'))

        if self._mode is 'xbmc':
            if override_view_mode:
                skin = xbmc.getSkinDir()
                thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin)
                if thumbnail_view:
                    cmd = 'Container.SetViewMode(%s)' % thumbnail_view
                    xbmc.executebuiltin(cmd)
            xbmcplugin.addDirectoryItems(self.handle, items, len(items))
            for id in sort_method_ids:
                xbmcplugin.addSortMethod(self.handle, id)
            xbmcplugin.endOfDirectory(self.handle, updateListing=is_update)

        return urls
Ejemplo n.º 2
0
 def add_items(self,
               iterable,
               is_update=False,
               sort_method_ids=[],
               override_view_mode=False):
     items = []
     urls = []
     for i, li_info in enumerate(iterable):
         items.append(self._make_listitem(**li_info))
         if self._mode in ['crawl', 'interactive', 'test']:
             print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
                                         '', li_info.get('url'))
             urls.append(li_info.get('url'))
     if self._mode is 'xbmc':
         if override_view_mode:
             skin = xbmc.getSkinDir()
             thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin)
             if thumbnail_view:
                 cmd = 'Container.SetViewMode(%s)' % thumbnail_view
                 xbmc.executebuiltin(cmd)
         xbmcplugin.addDirectoryItems(self.handle, items, len(items))
         for id in sort_method_ids:
             xbmcplugin.addSortMethod(self.handle, id)
         xbmcplugin.endOfDirectory(self.handle, updateListing=is_update)
     return urls
Ejemplo n.º 3
0
 def add_items(self, iterable, sort_method_ids=[]):
     items = []
     urls = []
     for i, li_info in enumerate(iterable):
         items.append(self._make_listitem(**li_info))
         if self._mode in ['crawl', 'interactive', 'test']:
             print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
                                         '', li_info.get('url'))
             urls.append(li_info.get('url'))
     if self._mode is 'xbmc':
         xbmcplugin.addDirectoryItems(self.handle, items, len(items))
         for id in sort_method_ids:
             xbmcplugin.addSortMethod(self.handle, id)
         xbmcplugin.endOfDirectory(self.handle, cacheToDisc=False)
     return urls
Ejemplo n.º 4
0
 def add_items(self, iterable, sort_method_ids=[]):
     items = []
     urls = []
     for i, li_info in enumerate(iterable):
         items.append(self._make_listitem(**li_info))
         if self._mode in ['crawl', 'interactive', 'test']:
             print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
                                         '', li_info.get('url'))
             urls.append(li_info.get('url'))
     if self._mode is 'xbmc':
         xbmcplugin.addDirectoryItems(self.handle, items, len(items))
         for id in sort_method_ids:
             xbmcplugin.addSortMethod(self.handle, id)
         xbmcplugin.endOfDirectory(self.handle, cacheToDisc=False)
     return urls
Ejemplo n.º 5
0
 def add_items(self, iterable, view_mode=None, is_update=False,
               sort_method_ids=[]):
     items = []
     urls = []
     for i, li_info in enumerate(iterable):
         items.append(self._make_listitem(**li_info))
         if self._mode in ['crawl', 'interactive', 'test']:
             print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
                                         '', li_info.get('url'))
             urls.append(li_info.get('url'))
     if self._mode is 'xbmc':
         if view_mode:
             xbmc.executebuiltin('Container.SetViewMode(%s)' % view_mode)
         xbmcplugin.addDirectoryItems(self.handle, items, len(items))
         for id in sort_method_ids:
             xbmcplugin.addSortMethod(self.handle, id)
         xbmcplugin.endOfDirectory(self.handle, updateListing=is_update)
     return urls
Ejemplo n.º 6
0
 def add_items(self, iterable, is_update=False, sort_method_ids=[],
               override_view_mode=False):
     items = []
     urls = []
     for i, li_info in enumerate(iterable):
         items.append(self._make_listitem(**li_info))
         if self._mode in ['crawl', 'interactive', 'test']:
             print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
                                         '', li_info.get('url'))
             urls.append(li_info.get('url'))
     if self._mode is 'xbmc':
         self.set_content('movies')
         xbmcplugin.addDirectoryItems(self.handle, items, len(items))
         for id in sort_method_ids:
             xbmcplugin.addSortMethod(self.handle, id)
         if override_view_mode:
             if xbmc.getSkinDir() == 'skin.confluence':
                 xbmc.executebuiltin('Container.SetViewMode(504)')
         xbmcplugin.endOfDirectory(self.handle, updateListing=is_update)
     return urls
Ejemplo n.º 7
0
 def add_items(self, iterable, is_update=False, sort_method_ids=[], override_view_mode=True):
     items = []
     urls = []
     for i, li_info in enumerate(iterable):
         items.append(self._make_listitem(**li_info))
         if self._mode in ["crawl", "interactive", "test"]:
             print "[%d] %s%s%s (%s)" % (i + 1, "", li_info.get("label"), "", li_info.get("url"))
             urls.append(li_info.get("url"))
     if self._mode is "xbmc":
         if override_view_mode:
             skin = xbmc.getSkinDir()
             thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin)
             if thumbnail_view:
                 cmd = "Container.SetViewMode(%s)" % thumbnail_view
                 xbmc.executebuiltin(cmd)
         xbmcplugin.addDirectoryItems(self.handle, items, len(items))
         for id in sort_method_ids:
             xbmcplugin.addSortMethod(self.handle, id)
         xbmcplugin.endOfDirectory(self.handle, updateListing=is_update)
     return urls