コード例 #1
0
ファイル: artist.py プロジェクト: jram60/plugin.audio.qobuz
    def makeListItem(self, replaceItems=False):
        import xbmcgui  # @UnresolvedImport
        image = self.get_image()
        url = self.make_url()
        name = self.get_label()
        item = xbmcgui.ListItem(name,
                                name,
                                image,
                                image,
                                url)
        if not item:
            warn(self, "Error: Cannot make xbmc list item")
            return None
        item.setPath(url)
        item.setInfo('music', infoLabels={
#            'genre': 'reggae', # self.get_genre(),
#            'year': '2000', # self.get_year(),
            'artist': self.get_artist(),
#            'album': self.get_title(),
            'comment': self.get_description()
#           'Artist_Description': 'coucou'
        })
        ctxMenu = contextMenu()
        self.attach_context_menu(item, ctxMenu)
        item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
        return item
コード例 #2
0
ファイル: playlist.py プロジェクト: tidalf/dc.xbmc.addons
    def makeListItem(self, replaceItems=False):
        colorItem = getSetting('item_default_color')
        colorPl = getSetting('item_section_color')
        label = self.get_label()
        image = self.get_image()
        owner = self.get_owner()
        url = self.make_url()
        if not self.is_my_playlist:
            label = '%s - %s' % (color(colorItem,owner), label)
        if self.b_is_current:
            label = '-o] %s [o-' % (color(colorPl, label))

        #label = color(colorPl, label)
        item = xbmcgui.ListItem(label,
                                owner,
                                image,
                                image,
                                url)
        if not item:
            warn(self, "Error: Cannot make xbmc list item")
            return None
        item.setPath(url)
        ctxMenu = contextMenu()
        self.attach_context_menu(item, ctxMenu)
        item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
        return item
コード例 #3
0
ファイル: article.py プロジェクト: jram60/plugin.audio.qobuz
    def makeListItem(self, **ka):

        item = xbmcgui.ListItem(self.get_label(), self.get_property('source'),
                                self.get_image(), self.get_image(), 'url=:p')
        ctxMenu = contextMenu()
        self.attach_context_menu(item, ctxMenu)
        item.addContextMenuItems(ctxMenu.getTuples(), ka['replaceItems'])
        return item
コード例 #4
0
 def makeListItem(self, replaceItems=False):
     item = xbmcgui.ListItem(self.get_label(),
                             self.get_label(),
                             self.get_image(),
                             self.get_image(),
                             self.make_url(),
                             )
     ctxMenu = contextMenu()
     self.attach_context_menu(item, ctxMenu)
     item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
     return item
コード例 #5
0
 def makeListItem(self, replaceItems=False):
     item = xbmcgui.ListItem(
         self.get_label(),
         self.get_label(),
         self.get_image(),
         self.get_image(),
         self.make_url(),
     )
     ctxMenu = contextMenu()
     self.attach_context_menu(item, ctxMenu)
     item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
     return item
コード例 #6
0
    def makeListItem(self, **ka):

        item = xbmcgui.ListItem(
            self.get_label(),
            self.get_property('source'),
            self.get_image(),
            self.get_image(),
            'url=:p'
        )
        ctxMenu = contextMenu()
        self.attach_context_menu(item, ctxMenu)
        item.addContextMenuItems(ctxMenu.getTuples(), ka['replaceItems'])
        return item
コード例 #7
0
ファイル: inode.py プロジェクト: jram60/plugin.audio.qobuz
 def makeListItem(self, **ka):
     import xbmcgui  # @UnresolvedImport
     if not 'url' in ka:
         ka['url'] = self.make_url()
     if not 'label' in ka:
         ka['label'] = self.get_label()
     if not 'label2' in ka:
         ka['label2'] = self.get_label()
     if not 'image' in ka:
         ka['image'] = self.get_image()
     item = xbmcgui.ListItem(ka['label'], ka['label2'], ka['image'],
                             ka['image'], ka['url'])
     ctxMenu = contextMenu()
     self.attach_context_menu(item, ctxMenu)
     item.addContextMenuItems(ctxMenu.getTuples(), ka['replaceItems'])
     item.addContextMenuItems(ctxMenu.getTuples(), ka['replaceItems'])
     return item
コード例 #8
0
ファイル: inode.py プロジェクト: erdoukki/plugin.audio.qobuz
 def makeListItem(self, **ka):
     import xbmcgui  # @UnresolvedImport
     if not 'url' in ka:
         ka['url'] = self.make_url()
     if not 'label' in ka:
         ka['label'] = self.get_label()
     if not 'label2' in ka:
         ka['label2'] = self.get_label()
     if not 'image' in ka:
         ka['image'] = self.get_image()
     item = xbmcgui.ListItem(
         ka['label'],
         ka['label2'],
         ka['image'],
         ka['image'],
         ka['url']
     )
     ctxMenu = contextMenu()
     self.attach_context_menu(item, ctxMenu)
     item.addContextMenuItems(ctxMenu.getTuples(), ka['replaceItems'])
     item.addContextMenuItems(ctxMenu.getTuples(), ka['replaceItems'])
     return item
コード例 #9
0
ファイル: album.py プロジェクト: erdoukki/plugin.audio.qobuz
 def makeListItem(self, replaceItems=False):
     import xbmcgui  # @UnresolvedImport
     image = self.get_image()
     item = xbmcgui.ListItem(
         label=self.get_label(),
         label2=self.get_label(),
         iconImage=image,
         thumbnailImage=image,
         path=self.make_url(),
     )
     item.setInfo('music', infoLabels={
         'genre': self.get_genre(),
         'year': self.get_year(),
         'artist': self.get_artist(),
         'title': self.get_title(),
         'album': self.get_title(),
         'comment': self.get_description()
     })
     ctxMenu = contextMenu()
     self.attach_context_menu(item, ctxMenu)
     item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
     return item
コード例 #10
0
 def makeListItem(self, replaceItems=False):
     import xbmcgui  # @UnresolvedImport
     image = self.get_image()
     item = xbmcgui.ListItem(
         label=self.get_label(),
         label2=self.get_label(),
         iconImage=image,
         thumbnailImage=image,
         path=self.make_url(),
     )
     item.setInfo('music',
                  infoLabels={
                      'genre': self.get_genre(),
                      'year': self.get_year(),
                      'artist': self.get_artist(),
                      'title': self.get_title(),
                      'album': self.get_title(),
                      'comment': self.get_description()
                  })
     ctxMenu = contextMenu()
     self.attach_context_menu(item, ctxMenu)
     item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
     return item
コード例 #11
0
    def makeListItem(self, replaceItems=False):
        import xbmcgui  # @UnresolvedImport
        media_number = self.get_media_number()
        if not media_number:
            media_number = 1
        else:
            media_number = int(media_number)
        duration = self.get_duration()
        if duration == -1:
            import pprint
            print "Error: no duration\n%s" % (pprint.pformat(self.data))
        label = self.get_label()
        isplayable = 'true'

        # Disable free account checking here, purchased track are
        # still playable even with free account, but we don't know yet.
        # if qobuz.gui.is_free_account():
        #    duration = 60
        # label = '[COLOR=FF555555]' + label + '[/COLOR]
        # [[COLOR=55FF0000]Sample[/COLOR]]'
        mode = Mode.PLAY
        url = self.make_url(mode=mode)
        image = self.get_image()
        item = xbmcgui.ListItem(label, label, image, image, url)
        item.setIconImage(image)
        item.setThumbnailImage(image)
        if not item:
            warn(self, "Cannot create xbmc list item")
            return None
        item.setPath(url)
        track_number = self.get_track_number()
        if not track_number:
            track_number = 0
        else:
            track_number = int(track_number)
        mlabel = self.get_property('label/name')
        description = self.get_description()
        comment = ''
        if mlabel:
            comment = mlabel
        if description:
            comment += ' - ' + description
        '''Xbmc Library fix: Compilation showing one entry by track
            We are setting artist like 'VA / Artist'
            Data snippet:
                {u'id': 26887, u'name': u'Interpr\xe8tes Divers'}
                {u'id': 145383, u'name': u'Various Artists'}
                {u'id': 255948, u'name': u'Multi Interpretes'}
        '''
        artist = self.get_artist()
        if self.parent and hasattr(self.parent, 'get_artist_id'):
            #             artist_id = str(self.parent.get_artist_id())
            #if artist_id in ['26887', '145383', '255948']:
            if self.parent.get_artist() != artist:
                artist = '%s / %s' % (self.parent.get_artist(), artist)
        desc = description or 'Qobuz Music Streaming'
        item.setInfo(
            type='music',
            infoLabels={
                'count':
                self.nid,
                'title':
                self.get_title(),
                'album':
                self.get_album(),
                'genre':
                self.get_genre(),
                'artist':
                artist,
                'tracknumber':
                track_number,
                'duration':
                duration,
                'year':
                self.get_year(),
                'comment':
                desc + '(aid=' + self.get_album_id() + ',curl=' +
                self.get_image() + ')'
                # 'lyrics': "Chant down babylon lalalala"
            })
        item.setProperty('DiscNumber', str(media_number))
        item.setProperty('IsPlayable', isplayable)
        item.setProperty('IsInternetStream', isplayable)
        item.setProperty('Music', isplayable)
        #        item.setProperty('mimetype', 'audio/mpeg')
        ctxMenu = contextMenu()
        self.attach_context_menu(item, ctxMenu)
        item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
        return item
コード例 #12
0
ファイル: track.py プロジェクト: erdoukki/plugin.audio.qobuz
    def makeListItem(self, replaceItems=False):
        import xbmcgui  # @UnresolvedImport
        media_number = self.get_media_number()
        if not media_number:
            media_number = 1
        else:
            media_number = int(media_number)
        duration = self.get_duration()
        if duration == -1:
            import pprint
            print "Error: no duration\n%s" % (pprint.pformat(self.data))
        label = self.get_label()
        isplayable = 'true'

        # Disable free account checking here, purchased track are
        # still playable even with free account, but we don't know yet.
        # if qobuz.gui.is_free_account():
        #    duration = 60
        # label = '[COLOR=FF555555]' + label + '[/COLOR]
        # [[COLOR=55FF0000]Sample[/COLOR]]'
        mode = Mode.PLAY
        url = self.make_url(mode=mode)
        image = self.get_image()
        item = xbmcgui.ListItem(label,
                                label,
                                image,
                                image,
                                url)
        item.setIconImage(image)
        item.setThumbnailImage(image)
        if not item:
            warn(self, "Cannot create xbmc list item")
            return None
        item.setPath(url)
        track_number = self.get_track_number()
        if not track_number:
            track_number = 0
        else:
            track_number = int(track_number)
        mlabel = self.get_property('label/name')
        description = self.get_description()
        comment = ''
        if mlabel:
            comment = mlabel
        if description:
            comment += ' - ' + description
        '''Xbmc Library fix: Compilation showing one entry by track
            We are setting artist like 'VA / Artist'
            Data snippet:
                {u'id': 26887, u'name': u'Interpr\xe8tes Divers'}
                {u'id': 145383, u'name': u'Various Artists'}
                {u'id': 255948, u'name': u'Multi Interpretes'}
        '''
        artist = self.get_artist()
        if self.parent and hasattr(self.parent, 'get_artist_id'):
#             artist_id = str(self.parent.get_artist_id())
            #if artist_id in ['26887', '145383', '255948']:
            if self.parent.get_artist() != artist:
                artist = '%s / %s' % (self.parent.get_artist(), artist)
        desc = description or 'Qobuz Music Streaming'
        item.setInfo(type='music', infoLabels={
                     'count': self.nid,
                     'title': self.get_title(),
                     'album': self.get_album(),
                     'genre': self.get_genre(),
                     'artist': artist,
                     'tracknumber': track_number,
                     'duration': duration,
                     'year': self.get_year(),
                     'comment': desc + '(aid=' + self.get_album_id()
                        + ',curl=' + self.get_image() + ')'
                     # 'lyrics': "Chant down babylon lalalala"
                     })
        item.setProperty('DiscNumber', str(media_number))
        item.setProperty('IsPlayable', isplayable)
        item.setProperty('IsInternetStream', isplayable)
        item.setProperty('Music', isplayable)
#        item.setProperty('mimetype', 'audio/mpeg')
        ctxMenu = contextMenu()
        self.attach_context_menu(item, ctxMenu)
        item.addContextMenuItems(ctxMenu.getTuples(), replaceItems)
        return item