예제 #1
0
def setView(content, viewType):
        
    if content:
        xbmcplugin.setContent(int(sys.argv[1]), content)
    if addon.get_setting('auto-view') == 'true':
        
        if viewType == 'Info':
            VT = '504'
        elif viewType == 'Info2':
            VT = '503'
        elif viewType == 'Info3':
            VT = '515'
        elif viewType == 'Fanart':
            VT = '508'
        elif viewType == 'PosterWrap':
            VT = '501'
        elif viewType == 'BigList':
            VT = '51'
        elif viewType == 'WideList':
            VT = '499'            
        elif viewType == 'default-view':
            VT = addon.get_setting(viewType)
                
        xbmc.executebuiltin("Container.SetViewMode(%s)" % ( int(VT) ) )

    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_UNSORTED )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_LABEL )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RATING )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_DATE )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_PROGRAM_COUNT )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RUNTIME )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_GENRE )
    xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_MPAA_RATING )
예제 #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']:
                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
예제 #3
0
파일: plugin.py 프로젝트: jbeluch/xbmcswift
    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
        #   make a list item
        #   if, set is_playable
        #   if, set context_menu
        #   append to new list
        #
        #   add the items
        #   call end of directory
        #   return the urls of each of the items

        #items = [self._make_list_item(**li_info) for li_info in iterable]

        items = [] # Keeps track of the list of tuples (url, list_item, is_folder) to pass to xbmcplugin.addDirectoryItems
        urls = [] # Keeps track of the XBMC urls for all of the list items
        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, C.blue, li_info.get('label'), C.end, li_info.get('url'))
                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 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
예제 #4
0
파일: plugin.py 프로젝트: jbeluch/xbmcswift
    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
        #   make a list item
        #   if, set is_playable
        #   if, set context_menu
        #   append to new list
        #
        #   add the items
        #   call end of directory
        #   return the urls of each of the items

        #items = [self._make_list_item(**li_info) for li_info in iterable]

        items = [
        ]  # Keeps track of the list of tuples (url, list_item, is_folder) to pass to xbmcplugin.addDirectoryItems
        urls = []  # Keeps track of the XBMC urls for all of the list items
        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, C.blue, li_info.get('label'), C.end, li_info.get('url'))
                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 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
예제 #5
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
def show_homepage():

    skin_used = xbmc.getSkinDir()
    if skin_used == 'skin.confluence':
        xbmc.executebuiltin('Container.SetViewMode(500)')  # "Thumbnail" view
    elif skin_used == 'skin.aeon.nox':
        xbmc.executebuiltin('Container.SetViewMode(512)')  # "Info-wall" view.

    if usern != '':
        items = [
            # SD Live
            {
                'label': plugin.get_string(30100),
                'thumbnail': 'http://195.222.33.193/kodi/livetv.png',
                'url': plugin.url_for('show_live', label='sd')
            },
            # Live cam
            {
                'label': plugin.get_string(30101),
                'thumbnail': 'http://195.222.33.193/kodi/cam.png',
                'url': plugin.url_for('show_live', label='cam')
            },
            # Radio
            {
                'label': plugin.get_string(30102),
                'thumbnail': 'http://195.222.33.193/kodi/radio.png',
                'url': plugin.url_for('show_live', label='radio')
            },
            # Recordings
            {
                'label': plugin.get_string(30103),
                'thumbnail': 'http://195.222.33.193/kodi/rec.png',
                'url': plugin.url_for('show_live', label='rec')
            },
        ]

    if usern == '':
        items = [
            # Live cam
            {
                'label': plugin.get_string(30101),
                'thumbnail': 'http://195.222.33.193/kodi/cam.png',
                'url': plugin.url_for('show_live', label='cam')
            },
            # Radio
            {
                'label': plugin.get_string(30102),
                'thumbnail': 'http://195.222.33.193/kodi/radio.png',
                'url': plugin.url_for('show_live', label='radio')
            },
        ]

    return plugin.add_items(items)
예제 #7
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
예제 #8
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
예제 #9
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
예제 #10
0
def show_homepage():


    skin_used = xbmc.getSkinDir()
    if skin_used == 'skin.confluence':
      xbmc.executebuiltin('Container.SetViewMode(500)') # "Thumbnail" view
    elif skin_used == 'skin.aeon.nox':
      xbmc.executebuiltin('Container.SetViewMode(512)') # "Info-wall" view.


    if usern!='':
      items = [
        # SD Live
        {'label': plugin.get_string(30100), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/livetv.png',
         'url': plugin.url_for('show_live', label='sd')},
        # Live cam
        {'label': plugin.get_string(30101), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/cam.png',
         'url': plugin.url_for('show_live', label='cam')},
         # Radio
        {'label': plugin.get_string(30102), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/radio.png',
         'url': plugin.url_for('show_live', label='radio')},
        # Recordings
        {'label': plugin.get_string(30103), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/rec.png',
         'url': plugin.url_for('show_live', label='rec')},

      ]

    if usern=='':
      items = [
        # Live cam
        {'label': plugin.get_string(30101), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/cam.png',
         'url': plugin.url_for('show_live', label='cam')},
         # Radio
        {'label': plugin.get_string(30102), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/radio.png',
         'url': plugin.url_for('show_live', label='radio')},

      ]

    return plugin.add_items(items)