Example #1
0
def set_download_artwork(mediatype):
    if mediatype not in mediatypes.artinfo:
        return
    options = list((x for x, y in mediatypes.artinfo[mediatype].items()
                    if y['autolimit']))
    options.extend(mediatypes.othertypes[mediatype])
    pykodi.get_main_addon().set_setting(mediatype + '.download_arttypes',
                                        ', '.join(options))
Example #2
0
 def update_useragent(self):
     beefversion = pykodi.get_main_addon().version
     if pykodi.get_kodi_version() < 17:
         from lib.libs import quickjson
         props = quickjson.get_application_properties(['name', 'version'])
         appversion = '{0}.{1}'.format(props['version']['major'], props['version']['minor'])
         self.useragent = 'ArtworkBeef/{0} {1}/{2}'.format(beefversion, props['name'], appversion)
         return
     self.useragent = 'ArtworkBeef/{0} '.format(beefversion) + xbmc.getUserAgent()
Example #3
0
import xbmc

from lib.libs import pykodi
try:
    import projectkeys
except ImportError:
    projectkeys = None

addon = pykodi.get_main_addon()

DEFAULT_IMAGESIZE = '1'
AVAILABLE_IMAGESIZES = {
    '0': (10000, 10000, 600),
    '1': (1920, 1080, 600),
    '2': (1280, 720, 480)
}

PROGRESS_DISPLAY_FULLPROGRESS = '0'
PROGRESS_DISPLAY_WARNINGSERRORS = '1'
PROGRESS_DISPLAY_NONE = '2'  # Only add-on crashes

EXCLUSION_PATH_TYPE_FOLDER = '0'
EXCLUSION_PATH_TYPE_PREFIX = '1'
EXCLUSION_PATH_TYPE_REGEX = '2'


class Settings(object):
    def __init__(self):
        self.addon_path = addon.path
        self.datapath = addon.datapath
        self._autoadd_episodes = ()