Exemple #1
0
    def get_assist_torrents(self):
        tools.addDirectoryItem('Clear Non Active...', 'nonActiveAssistClear', None, None)
        torrent_list = database.get_assist_torrents()
        if torrent_list is not None:

            for i in torrent_list:
                debrid = tools.shortened_debrid(i['provider'])
                title = tools.colorString('%s - %s - %s%% : %s' % (debrid, i['status'].title(),
                                                                 i['progress'], i['release_title']))
                tools.addDirectoryItem(title, '', None, None)

        tools.closeDirectory('addons')
Exemple #2
0
    def get_assist_torrents(self):
        g.add_directory_item(g.get_language_string(30245),
                             action='nonActiveAssistClear')
        torrent_list = self.torrent_assist.get_assist_torrents()
        if torrent_list is not None:

            for i in torrent_list:
                debrid = tools.shortened_debrid(i['provider'])
                title = g.color_string('{} - {} - {}% : {}'.format(
                    debrid, i['status'].title(), i['progress'],
                    i['release_title']))
                g.add_directory_item(title)

        g.close_directory(self.view_type)
Exemple #3
0
def build_display_title(source):
    if 'debrid_provider' in source:
        debrid_provider = tools.colorString(tools.shortened_debrid(source.get('debrid_provider', '')))
        if debrid_provider != '':
            debrid_provider = " " + debrid_provider + " |"
        else:
            tools.log('No Debrid Provider')
    else:
        debrid_provider = ''
    quality = tools.color_quality(source['quality'])
    release_title = tools.colorString(source['release_title'])
    info = source['info']
    if len(info) > 0:
        info = ' '.join(info)
        info = '| ' + info
    else:
        info = ''

    title = ''

    if source['type'] == 'torrent':
        size = tools.colorString(tools.source_size_display(source['size']))
        title = "%s |%s %s | %s %s\n%s" % (
            quality,
            debrid_provider,
            source['source'].upper(),
            size,
            info,
            release_title
        )
    if source['type'] == 'hoster':
        title = "%s |%s %s | %s %s\n%s" % (
            quality,
            debrid_provider,
            source['provider'].upper(),
            source['source'],
            info,
            release_title,
        )

    if tools.getSetting('general.sourceselectlines') == 'false':
        title = title.replace('\n', ' | ')

    return title