• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python plugin.get_setting函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中meta.plugin.get_setting函数的典型用法代码示例。如果您正苦于以下问题:Python get_setting函数的具体用法?Python get_setting怎么用?Python get_setting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_setting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: batch_add_movies_to_library

def batch_add_movies_to_library(library_folder, id):
    if id == None:
        return
    changed = False
    movie_folder = os.path.join(library_folder, str(id)+'/')
    if not xbmcvfs.exists(movie_folder):
        try: xbmcvfs.mkdir(movie_folder)
        except: pass
    nfo_filepath = os.path.join(movie_folder, str(id)+ "%s" % plugin.get_setting(SETTING_LIBRARY_TAGS, unicode) + ".nfo")
    if not xbmcvfs.exists(nfo_filepath):
        changed = True
        nfo_file = xbmcvfs.File(nfo_filepath, 'w')
        content = "http://www.imdb.com/title/%s/" % str(id)
        nfo_file.write(content)
        nfo_file.close()
    strm_filepath = os.path.join(movie_folder, str(id) + "%s" % plugin.get_setting(SETTING_LIBRARY_TAGS, unicode) + ".strm")
    src = "imdb"
    if not xbmcvfs.exists(strm_filepath):
        changed = True
        strm_file = xbmcvfs.File(strm_filepath, 'w')
        try:
            content = plugin.url_for("movies_play", src=src, id=id, mode='library')
            strm_file.write(content)
            strm_file.close()
        except:
            pass
#    if xbmc.getCondVisibility("system.hasaddon(script.qlickplay)"): xbmc.executebuiltin("RunScript(script.qlickplay,info=afteradd)")
#    elif xbmc.getCondVisibility("system.hasaddon(script.extendedinfo)"): xbmc.executebuiltin("RunScript(script.extendedinfo,info=afteradd)")
    return changed
开发者ID:vphuc81,项目名称:MyRepository,代码行数:29,代码来源:movies.py


示例2: total

def total():
    xbmc.executebuiltin('SetProperty(running,totalmeta,home)')
    plugin.notify(msg=_('Automated install'), title=_('Started'), delay=1000, image=get_icon_path("meta"))
    url = "https://api.github.com/repos/OpenELEQ/unofficial-meta-players-verified/zipball"
    if updater.update_players(url):
        plugin.notify(msg=_('Players'), title=_('Updated'), delay=1000, image=get_icon_path("player"))
    else:
        plugin.notify(msg=_('Players update'), title=_('Failed'), delay=1000, image=get_icon_path("player"))
    xbmc.executebuiltin("RunPlugin(plugin://plugin.video.meta/settings/players/all/)")
    movielibraryfolder = plugin.get_setting(SETTING_MOVIES_LIBRARY_FOLDER)
    try:
        meta.library.movies.auto_movie_setup(movielibraryfolder)
        plugin.notify(msg=_('Movies library folder'), title=_('Setup Done'), delay=1000, image=get_icon_path("movies"))
    except:
        plugin.notify(msg=_('Movies library folder'), title=_('Setup Failed'), delay=1000, image=get_icon_path("movies"))
    tvlibraryfolder = plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)
    try:
        meta.library.tvshows.auto_tv_setup(tvlibraryfolder)
        plugin.notify(msg=_('TVShows library folder'), title=_('Setup Done'), delay=1000, image=get_icon_path("tv"))
    except:
        plugin.notify(msg=_('TVShows library folder'), title=_('Setup Failed'), delay=1000, image=get_icon_path("player"))
    xbmc.sleep(5000)
    while xbmc.getCondVisibility("Window.IsActive(dialoginfo)"):
        if not xbmc.getCondVisibility("Window.IsActive(dialoginfo)"):
            break
    plugin.notify(msg=_('Automated install'), title=_('Completed'), delay=5000, image=get_icon_path("meta"))
    xbmc.executebuiltin('ClearProperty(running,home)')
开发者ID:OpenELEQ,项目名称:testing.meta.more,代码行数:27,代码来源:addon.py


示例3: toggle_between_skins

def toggle_between_skins():
    if xbmc.getCondVisibility("Skin.HasSetting(Contexting)") != True: contexting = False
    else: contexting = True
    if xbmc.getCondVisibility("Skin.HasSetting(Toggling)") != True: toggling = False
    else: toggling = True
    current_skin = str(xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.GetSettingValue","params":{"setting":"lookandfeel.skin"}, "id":1}')).replace('{"id":1,"jsonrpc":"2.0","result":{"value":"','').replace('"}}','')
    primary_skin = plugin.get_setting(SETTING_PRIMARY_SKIN, unicode)
    if primary_skin == "": plugin.set_setting(SETTING_PRIMARY_SKIN, current_skin)
    alternate_skin = plugin.get_setting(SETTING_ALTERNATE_SKIN, unicode)
    if alternate_skin == "":
        if primary_skin != "skin.confluence" and primary_skin != "": plugin.set_setting(SETTING_ALTERNATE_SKIN, "skin.confluence")
        else:
            dialogs.notify(msg="Alternate skin", title="Not set", delay=5000, image=get_icon_path("metalliq"))
            return openSettings(addonid, 5.7)
    if primary_skin != alternate_skin and primary_skin != "" and alternate_skin != "" and xbmc.getCondVisibility('System.HasAddon(%s)' % primary_skin) and xbmc.getCondVisibility('System.HasAddon(%s)' % alternate_skin):
        if current_skin != primary_skin:
            xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{"setting":"lookandfeel.skin","value":"%s"}, "id":1}' % primary_skin)
            xbmc.executebuiltin('SetFocus(11)')
            xbmc.executebuiltin('Action(Select)')
        else:
            xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{"setting":"lookandfeel.skin","value":"%s"}, "id":1}' % alternate_skin)
            xbmc.executebuiltin('SetFocus(11)')
            xbmc.executebuiltin('Action(Select)')
        xbmc.sleep(2000)
        if contexting == False and xbmc.getCondVisibility("Skin.HasSetting(Contexting)") == True: toggle_context_player()
        elif contexting == True and xbmc.getCondVisibility("Skin.HasSetting(Contexting)") == False: toggle_context_player()
        else: pass
        if toggling == False and xbmc.getCondVisibility("Skin.HasSetting(Toggling)") == True: toggle_preferred_toggle()
        elif toggling == True and xbmc.getCondVisibility("Skin.HasSetting(Toggling)") == False: toggle_preferred_toggle()
        else: pass
开发者ID:vphuc81,项目名称:MyRepository,代码行数:30,代码来源:default.py


示例4: setup_library

def setup_library(library_folder):
    if library_folder[-1] != "/":
        library_folder += "/"
    metalliq_playlist_folder = "special://profile/playlists/mixed/MetalliQ/"
    if not xbmcvfs.exists(metalliq_playlist_folder):
        xbmcvfs.mkdir(metalliq_playlist_folder)
    playlist_folder = plugin.get_setting(SETTING_MOVIES_PLAYLIST_FOLDER, converter=str)
    if plugin.get_setting(SETTING_MOVIES_PLAYLIST_FOLDER, converter=str)[-1] != "/":
        playlist_folder += "/"
    # create folders
    if not xbmcvfs.exists(playlist_folder):
        xbmcvfs.mkdir(playlist_folder)
    if not xbmcvfs.exists(library_folder):
        # create folder
        xbmcvfs.mkdir(library_folder)
        # auto configure folder
        msg = _(
            "Would you like to automatically set [COLOR ff0084ff]M[/COLOR]etalli[COLOR ff0084ff]Q[/COLOR] as a movies video source?"
        )
        if dialogs.yesno(_("Library setup"), msg):
            source_thumbnail = get_icon_path("movies")
            source_name = "[COLOR ff0084ff]M[/COLOR]etalli[COLOR ff0084ff]Q[/COLOR] " + _("Movies")
            source_content = '(\'{0}\',\'movies\',\'metadata.themoviedb.org\',\'\',2147483647,1,\'<settings><setting id="RatingS" value="TMDb" /><setting id="certprefix" value="Rated " /><setting id="fanart" value="true" /><setting id="keeporiginaltitle" value="false" /><setting id="language" value="{1}" /><setting id="tmdbcertcountry" value="us" /><setting id="trailer" value="true" /></settings>\',0,0,NULL,NULL)'.format(
                library_folder, LANG
            )
            add_source(source_name, library_folder, source_content, source_thumbnail)
    # return translated path
    return xbmc.translatePath(library_folder)
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:28,代码来源:movies.py


示例5: playlist_folders_setup

def playlist_folders_setup():
    movies_playlist_folder = plugin.get_setting(SETTING_MOVIES_PLAYLIST_FOLDER)
    if not xbmcvfs.exists(movies_playlist_folder):
        xbmcvfs.mkdir(movies_playlist_folder)
    elif xbmcvfs.exists(movies_playlist_folder):
        plugin.notify(msg="Movie playlist folder", title="Already exists", delay=1000, image=get_icon_path("lists"))
    else:
        plugin.notify(msg="Movie playlist folder creation", title="Failed", delay=1000, image=get_icon_path("lists"))
    tv_playlist_folder = plugin.get_setting(SETTING_TV_PLAYLIST_FOLDER)
    if not xbmcvfs.exists(tv_playlist_folder):
        xbmcvfs.mkdir(tv_playlist_folder)
    elif xbmcvfs.exists(tv_playlist_folder):
        plugin.notify(msg="TVShow playlist folder", title="Already exists", delay=1000, image=get_icon_path("lists"))
    else:
        plugin.notify(msg="TVShow playlist folder creation", title="Failed", delay=1000, image=get_icon_path("lists"))
    music_playlist_folder = plugin.get_setting(SETTING_MUSIC_PLAYLIST_FOLDER)
    if not xbmcvfs.exists(music_playlist_folder):
        xbmcvfs.mkdir(music_playlist_folder)
    elif xbmcvfs.exists(music_playlist_folder):
        plugin.notify(msg="Music playlist folder", title="Already exists", delay=1000, image=get_icon_path("lists"))
    else:
        plugin.notify(msg="Music playlist folder creation", title="Failed", delay=1000, image=get_icon_path("lists"))
    live_playlist_folder = plugin.get_setting(SETTING_LIVE_PLAYLIST_FOLDER)
    if not xbmcvfs.exists(live_playlist_folder):
        xbmcvfs.mkdir(live_playlist_folder)
    elif xbmcvfs.exists(live_playlist_folder):
        plugin.notify(msg="Live playlist folder", title="Already exists", delay=1000, image=get_icon_path("lists"))
    else:
        plugin.notify(msg="Live playlist folder creation", title="Failed", delay=1000, image=get_icon_path("lists"))
    plugin.notify(msg="Playlists folder creation", title="Completed", delay=1000, image=get_icon_path("lists"))
    return True
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:31,代码来源:addon.py


示例6: source_setup

def source_setup():
    movielibraryfolder = plugin.get_setting(SETTING_MOVIES_LIBRARY_FOLDER)
    try:
        meta.library.movies.auto_movie_setup(movielibraryfolder)
        plugin.notify(msg=_("Movies library folder"), title=_("Setup Done"), delay=1000, image=get_icon_path("movies"))
    except:
        plugin.notify(
            msg=_("Movies library folder"), title=_("Setup Failed"), delay=1000, image=get_icon_path("movies")
        )
    tvlibraryfolder = plugin.get_setting(SETTING_TV_LIBRARY_FOLDER)
    try:
        meta.library.tvshows.auto_tvshows_setup(tvlibraryfolder)
        plugin.notify(msg=_("TV shows library folder"), title=_("Setup Done"), delay=1000, image=get_icon_path("tv"))
    except:
        plugin.notify(msg=_("TV shows library folder"), title=_("Setup Failed"), delay=1000, image=get_icon_path("tv"))
    musiclibraryfolder = plugin.get_setting(SETTING_MUSIC_LIBRARY_FOLDER)
    try:
        meta.library.music.auto_music_setup(musiclibraryfolder)
        plugin.notify(msg=_("Music library folder"), title=_("Setup Done"), delay=1000, image=get_icon_path("music"))
    except:
        plugin.notify(msg=_("Music library folder"), title=_("Setup Failed"), delay=1000, image=get_icon_path("music"))
    livelibraryfolder = plugin.get_setting(SETTING_LIVE_LIBRARY_FOLDER)
    try:
        meta.library.live.auto_live_setup(livelibraryfolder)
        plugin.notify(msg=_("Live library folder"), title=_("Setup Done"), delay=1000, image=get_icon_path("live"))
    except:
        plugin.notify(msg=_("Live library folder"), title=_("Setup Failed"), delay=1000, image=get_icon_path("live"))
    return True
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:28,代码来源:addon.py


示例7: play_channel

def play_channel(channel, program, language, mode):
    # Get players to use
    if mode == 'select':
        play_plugin = ADDON_SELECTOR.id
    elif mode == 'context':
        play_plugin = plugin.get_setting(SETTING_LIVE_DEFAULT_PLAYER_FROM_CONTEXT, unicode)
    elif mode == 'library':
        play_plugin = plugin.get_setting(SETTING_LIVE_DEFAULT_PLAYER_FROM_LIBRARY, unicode)
    elif mode == 'default':
        play_plugin = plugin.get_setting(SETTING_LIVE_DEFAULT_PLAYER, unicode)
    else:
        play_plugin = mode
    players = active_players("live")
    players = [p for p in players if p.id == play_plugin] or players
    if not players:
        dialogs.notify(msg="{0} {1} {2}".format(_("No cache").replace(_("Cache").lower(),_("TV")), _("Player").lower(), _("Enabled").lower()), title=_("Error"), delay=5000, image=get_icon_path("live"))
        action_cancel()
        return
    # Get parameters
    params = {}
    for lang in get_needed_langs(players):
        params[lang] = get_channel_parameters(channel, program, language)
        params[lang] = to_unicode(params[lang])
    # Go for it
    link = on_play_video(mode, players, params)
    if link:
        action_play({
            'label': channel,
            'path': link,
            'is_playable': True,
            'info_type': 'video',
        })
开发者ID:vphuc81,项目名称:MyRepository,代码行数:32,代码来源:live.py


示例8: play_music

def play_music(artist_name, track_name, album_name, mode = "default"):
    # Get players to use
    if mode == 'select':
        play_plugin = ADDON_SELECTOR.id
    elif mode == 'context':
        play_plugin = plugin.get_setting(SETTING_MUSIC_DEFAULT_PLAYER_FROM_CONTEXT)
    elif mode == 'library':
        play_plugin = plugin.get_setting(SETTING_MUSIC_DEFAULT_PLAYER_FROM_LIBRARY)
    elif mode == 'default':
        play_plugin = plugin.get_setting(SETTING_MUSIC_DEFAULT_PLAYER)
    else:
        play_plugin = mode
    players = active_players("music")
    players = [p for p in players if p.id == play_plugin] or players
    if not players:
        xbmc.executebuiltin("Action(Info)")
        action_cancel()
        return

    # Get parameters
    params = {}
    for lang in get_needed_langs(players):
        params[lang] = get_music_parameters(artist_name, album_name, track_name)
        params[lang] = to_unicode(params[lang])

    # Go for it
    link = on_play_video(mode, players, params)
    if link:
        action_play({
            'label': "{0} - {1} - {2}".format(artist_name, album_name, track_name),
            'path': link,
            'is_playable': True,
            'info_type': 'music',
        })
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:34,代码来源:music.py


示例9: movies_batch_add_to_library

def movies_batch_add_to_library():
    """ Batch add movies to library """
    movie_batch_file = plugin.get_setting(SETTING_MOVIES_BATCH_ADD_FILE_PATH)
    if xbmcvfs.exists(movie_batch_file):
        try:
            f = open(xbmc.translatePath(movie_batch_file), 'r')
            r = f.read()
            f.close()
            ids = r.split('\n')
        except: return plugin.notify(msg='Movies Batch Add File', title='Not found', delay=3000, image=get_icon_path("movies"))
        library_folder = setup_library(plugin.get_setting(SETTING_MOVIES_LIBRARY_FOLDER))
        import_tmdb()
        for id in ids:
            if "," in id:
                csvs = id.split(',')
                for csv in csvs:
                    if not str(csv).startswith("tt") and csv != "":
                        movie = tmdb.Movies(csv).info()
                        id = movie.get('imdb_id')
                    batch_add_movies_to_library(library_folder, id)
            else:
                if not str(id).startswith("tt") and id != "":
                    movie = tmdb.Movies(id).info()
                    id = movie.get('imdb_id')
                batch_add_movies_to_library(library_folder, id)
        os.remove(xbmc.translatePath(movie_batch_file))
        if xbmcvfs.exists(plugin.get_setting(SETTING_TV_BATCH_ADD_FILE_PATH)): 
            xbmc.executebuiltin("RunPlugin(plugin://plugin.video.metalliq/tv/batch_add_to_library)")
            return True
        else:
            xbmc.sleep(1000)
            plugin.notify(msg='Added movie strm-files', title='Starting library scan', delay=3000, image=get_icon_path("movies"))
            scan_library(type="video")
            return True
    elif xbmcvfs.exists(plugin.get_setting(SETTING_TV_BATCH_ADD_FILE_PATH)): xbmc.executebuiltin("RunPlugin(plugin://plugin.video.metalliq/tv/batch_add_to_library)")
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:35,代码来源:movies.py


示例10: toggle_between_skins

def toggle_between_skins():
    if xbmc.getCondVisibility("Skin.HasSetting(Contexting)") != True:
        contexting = False
    else:
        contexting = True
    if xbmc.getCondVisibility("Skin.HasSetting(Toggling)") != True:
        toggling = False
    else:
        toggling = True
    current_skin = (
        str(
            xbmc.executeJSONRPC(
                '{"jsonrpc":"2.0", "method":"Settings.GetSettingValue","params":{"setting":"lookandfeel.skin"}, "id":1}'
            )
        )
        .replace('{"id":1,"jsonrpc":"2.0","result":{"value":"', "")
        .replace('"}}', "")
    )
    primary_skin = plugin.get_setting(SETTING_PRIMARY_SKIN, converter=str)
    alternate_skin = plugin.get_setting(SETTING_ALTERNATE_SKIN, converter=str)
    if primary_skin == "":
        plugin.set_setting(SETTING_PRIMARY_SKIN, current_skin)
    if alternate_skin == "":
        if primary_skin != "skin.confluence":
            plugin.set_setting(SETTING_ALTERNATE_SKIN, "skin.confluence")
        else:
            plugin.notify(
                msg="Alternate skin", title="Not set", delay=5000, image=get_icon_path("metalliq")
            ), openSettings(addonid, 5.5)
    if (
        primary_skin != alternate_skin
        and primary_skin != ""
        and alternate_skin != ""
        and xbmc.getCondVisibility("System.HasAddon(%s)" % primary_skin)
        and xbmc.getCondVisibility("System.HasAddon(%s)" % alternate_skin)
    ):
        if current_skin != primary_skin:
            xbmc.executeJSONRPC(
                '{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{"setting":"lookandfeel.skin","value":"%s"}, "id":1}'
                % primary_skin
            )
            xbmc.executebuiltin("SetFocus(11)")
            xbmc.executebuiltin("Action(Select)")
        else:
            xbmc.executeJSONRPC(
                '{"jsonrpc":"2.0", "method":"Settings.SetSettingValue","params":{"setting":"lookandfeel.skin","value":"%s"}, "id":1}'
                % alternate_skin
            )
            xbmc.executebuiltin("SetFocus(11)")
            xbmc.executebuiltin("Action(Select)")
        if toggling == False:
            xbmc.executebuiltin("Skin.Reset(Toggling)")
        else:
            xbmc.executebuiltin("Skin.SetBool(Toggling)")
        if contexting == False:
            xbmc.executebuiltin("Skin.Reset(Contexting)")
        else:
            xbmc.executebuiltin("Skin.SetBool(Contexting)")
开发者ID:noobsandnerds,项目名称:noobsandnerds,代码行数:58,代码来源:addon.py


示例11: __init__

    def __init__(self):
        Thread.__init__(self)
        
        self.active = True
        self.search_term = None
        self.owner_thread = None
        self.lock = Lock()
        self.access_lock = RLock()

        self.hide_keyboard = plugin.get_setting(SETTING_AUTO_HIDE_DIALOGS, bool) and plugin.get_setting(SETTING_AUTO_HIDE_DIALOGS_KEYBOARD, bool)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:10,代码来源:lister.py


示例12: play_movie

def play_movie(tmdb_id, mode):
    import_tmdb()
    # Get players to use
    if mode == 'select':
        play_plugin = ADDON_SELECTOR.id
    elif mode == 'context':
        play_plugin = plugin.get_setting(SETTING_MOVIES_DEFAULT_PLAYER_FROM_CONTEXT, unicode)
    elif mode == 'library':
        play_plugin = get_movie_player_plugin_from_library(tmdb_id)
        if not play_plugin or play_plugin == "default":
            play_plugin = plugin.get_setting(SETTING_MOVIES_DEFAULT_PLAYER_FROM_LIBRARY, unicode)
    elif mode == 'default':
        play_plugin = plugin.get_setting(SETTING_MOVIES_DEFAULT_PLAYER, unicode)
    else:
        play_plugin = mode
    if mode == 'default' or mode == 'select': players = active_players("movies")
    else: players = get_players("movies")
    players = [p for p in players if p.id == play_plugin] or players
    if not players:
        xbmc.executebuiltin( "Action(Info)")
        action_cancel()
        return
    # Get movie data from TMDB
    movie = tmdb.Movies(tmdb_id).info(language=LANG, append_to_response="external_ids,videos")
    movie_info = get_movie_metadata(movie)
    # Get movie ids from Trakt
    trakt_ids = get_trakt_ids("tmdb", tmdb_id, movie['original_title'],
                    "movie", parse_year(movie['release_date']))
    # Get parameters
    params = {}
    for lang in get_needed_langs(players):
        if lang == LANG:
            tmdb_data = movie
        else:
            tmdb_data = tmdb.Movies(tmdb_id).info(language=lang)
        params[lang] = get_movie_parameters(tmdb_data)
        if trakt_ids != None:
            params[lang].update(trakt_ids)
        params[lang]['info'] = movie_info
        params[lang] = to_unicode(params[lang])
    # Go for it
    link = on_play_video(mode, players, params, trakt_ids)
    if link:
        movie = tmdb.Movies(tmdb_id).info(language=LANG)
        action_play({
            'label': movie_info['title'],
            'path': link,
            'info': movie_info,
            'is_playable': True,
            'info_type': 'video',
            'thumbnail': movie_info['poster'],
            'poster': movie_info['poster'],
            'properties' : {'fanart_image' : movie_info['fanart']},
        })
开发者ID:vphuc81,项目名称:MyRepository,代码行数:54,代码来源:movies.py


示例13: live_add_to_library

def live_add_to_library(channel, mode):
    if mode != None and plugin.get_setting(SETTING_LIVE_DEFAULT_AUTO_ADD, bool):
        player = mode
    else:
        players = active_players("live", filters = {'network': channel.get('network')})
        players.insert(0, ADDON_SELECTOR)
        selection = dialogs.select(_("Play using..."), [p.title for p in players])
        if selection == -1:
            return
        player = players[selection]
    library_folder = setup_library(plugin.get_setting(SETTING_LIVE_LIBRARY_FOLDER, unicode))
    add_channel_to_library(library_folder, channel, player)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:12,代码来源:live.py


示例14: main

def main():
    go_idle(45)
    if plugin.get_setting(SETTING_TOTAL_SETUP_DONE, bool) == False:
        xbmc.executebuiltin('RunPlugin(plugin://plugin.video.metalliq/setup/total)')
        plugin.set_setting(SETTING_TOTAL_SETUP_DONE, "true")
    #xbmc.executebuiltin("RunPlugin(plugin://plugin.video.metalliq/movies/batch_add_to_library)")
    next_update = future(0)
    while not xbmc.abortRequested:
        if next_update <= future(0):
            next_update = future(plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60 * 60)
            update_library()
        go_idle(30*60)
开发者ID:vphuc81,项目名称:MyRepository,代码行数:12,代码来源:service.py


示例15: __init__

 def __init__(self):
     self.active = False
     
     self.hide_progress = False
     self.hide_info = False
     
     self.autohidedialogs = plugin.get_setting(SETTING_AUTO_HIDE_DIALOGS, bool)
     if self.autohidedialogs:
         self.hide_progress = plugin.get_setting(SETTING_AUTO_HIDE_DIALOGS_PROGRESS, bool)
         self.hide_info = plugin.get_setting(SETTING_AUTO_HIDE_DIALOGS_INFO, bool)
     
     if not self.hide_progress and not self.hide_info:
         self.autohidedialogs = False
开发者ID:vphuc81,项目名称:MyRepository,代码行数:13,代码来源:dialogs.py


示例16: auto_tvshows_setup

def auto_tvshows_setup(library_folder):
    if library_folder[-1] != "/": library_folder += "/"
    playlist_folder = plugin.get_setting(SETTING_TV_PLAYLIST_FOLDER, unicode)
    if plugin.get_setting(SETTING_TV_PLAYLIST_FOLDER, unicode)[-1] != "/": playlist_folder += "/"
    if not xbmcvfs.exists(playlist_folder): xbmcvfs.mkdir(playlist_folder)
    if not xbmcvfs.exists(library_folder):
        try:
            xbmcvfs.mkdir(library_folder)
            source_thumbnail = get_icon_path("tv")
            source_name = "[COLOR ff0084ff]M[/COLOR]etalli[COLOR ff0084ff]Q[/COLOR] " + _("TV shows")
            source_content = "('{0}','tvshows','metadata.tvdb.com','',0,0,'<settings><setting id=\"RatingS\" value=\"TheTVDB\" /><setting id=\"absolutenumber\" value=\"false\" /><setting id=\"dvdorder\" value=\"false\" /><setting id=\"fallback\" value=\"true\" /><setting id=\"fanart\" value=\"true\" /><setting id=\"language\" value=\"{1}\" /></settings>',0,0,NULL,NULL)".format(library_folder, LANG)
            add_source(source_name, library_folder, source_content, source_thumbnail)
            return True
        except: False
开发者ID:vphuc81,项目名称:MyRepository,代码行数:14,代码来源:tvshows.py


示例17: silent_setup

def silent_setup():
    xbmc.executebuiltin('SetProperty(running,totalmetalliq,home)')
    movielibraryfolder = plugin.get_setting(SETTING_MOVIES_LIBRARY_FOLDER, unicode)
    try: meta.library.movies.auto_movie_setup(movielibraryfolder)
    except: pass
    tvlibraryfolder = plugin.get_setting(SETTING_TV_LIBRARY_FOLDER, unicode)
    try: meta.library.tvshows.auto_tvshows_setup(tvlibraryfolder)
    except: pass
    musiclibraryfolder = plugin.get_setting(SETTING_MUSIC_LIBRARY_FOLDER, unicode)
    try: meta.library.music.auto_music_setup(musiclibraryfolder)
    except: pass
    livelibraryfolder = plugin.get_setting(SETTING_LIVE_LIBRARY_FOLDER, unicode)
    try: meta.library.live.auto_live_setup(livelibraryfolder)
    except: pass
开发者ID:vphuc81,项目名称:MyRepository,代码行数:14,代码来源:default.py


示例18: update_library

def update_library():
    """ Update library """
    url = plugin.get_setting(SETTING_MOVIES_SERVER_URL, converter=str)
    if not url:
        return
    
    # Get movies list from movies-server
    movies = query_movies_server(url)
    
    # setup library folder
    library_folder = setup_library(plugin.get_setting(SETTING_MOVIES_LIBRARY_FOLDER))

    changed = False

    # add new movies
    for movie in movies:
        date = int(movie.get('date', 0))
        imdb = movie.get('imdb')
        tmdb = movie.get('tmdb')
        
        if imdb:
            if add_movie_to_library(library_folder, "imdb", imdb, date):
                changed = True
        elif tmdb:
            if add_movie_to_library(library_folder, "tmdb", tmdb, date):
                changed = True
        
    # remove old movies from DB
    keep_movies = [movie['imdb'] for movie in movies]
    
    db_movies = RPC.video_library.get_movies(properties=['title', 'imdbnumber','file'])    
    for movie in db_movies.get('movies', []):
        file = xbmc.translatePath(movie['file'])
        imdb = os.path.splitext(os.path.basename(file))[0]
        if imdb not in keep_movies and plugin.id in file:
            
            # remove movie
            RPC.video_library.remove_movie(movieid=movie["movieid"])
            
            # remove strm and nfo files
            os.remove(file)
            try:
                os.remove(file.replace(".strm", ".nfo"))
            except:
                pass
            
            changed = True
    
    if changed:
        scan_library()
开发者ID:OpenELEQ,项目名称:testing.meta,代码行数:50,代码来源:movies.py


示例19: get_video_link

def get_video_link(players, params, mode, use_simple=False):
    lister = Lister()
    # Extend parameters
    for lang, lang_params in params.items():
        for key, value in lang_params.items():
            if isinstance(value, basestring):
                params[lang][key + "_+"] = value.replace(" ", "+")
                params[lang][key + "_-"] = value.replace(" ", "-")
                params[lang][key + "_escaped"] = value.replace(" ", "%2520")
                params[lang][key + "_escaped+"] = value.replace(" ", "%252B")
    pDialog = None
    selection = None
    try:
        if len(players) > 1 and use_simple:
            index = dialogs.select(_("Play using..."), [player.title for player in players])
            if index == -1: return None
            players = [players[index]]
        resolve_f = lambda p : resolve_player(p, lister, params)
        if len(players) > 1:
            pool_size = plugin.get_setting(SETTING_POOL_SIZE, int)
            populator = lambda : execute(resolve_f, players, lister.stop_flag, pool_size)
            selection = dialogs.select_ext(_("Play using..."), populator, len(players))
        else:
            result = resolve_f(players[0])
            if result:
                title, links = result
                if len(links) == 1: selection = links[0]
                else:
                    index = dialogs.select(_("Play using..."), [x['label'] for x in links])
                    if index > -1: selection = links[index]
            else: dialogs.ok(_("Error"), _("%s not found") % _("Video"))
    finally: lister.stop()
    return selection
开发者ID:vphuc81,项目名称:MyRepository,代码行数:33,代码来源:base.py


示例20: play_channel

def play_channel(channel, mode="default"):
    # Get players to use
    if mode == 'select':
        play_plugin = ADDON_SELECTOR.id
    else:
        play_plugin = plugin.get_setting(SETTING_LIVE_DEFAULT_PLAYER)
    players = active_players("live", filters = {"channel": channel})
    players = [p for p in players if p.id == play_plugin] or players
    if not players:
        xbmc.executebuiltin( "Action(Info)")
        action_cancel()
        return

    # Get parameters
    params = {}
    for lang in get_needed_langs(players):
        params[lang] = get_channel_parameters(channel)
        params[lang] = to_unicode(params[lang])

    # Go for it
    link = on_play_video(mode, players, params)
    if link:
        action_play({
            'label': channel,
            'path': link,
            'is_playable': True,
            'info_type': 'video',
        })
开发者ID:OpenELEQ,项目名称:testing.meta.more,代码行数:28,代码来源:live.py



注:本文中的meta.plugin.get_setting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python plugin.url_for函数代码示例发布时间:2022-05-27
下一篇:
Python plugin.finish函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap