Exemplo n.º 1
0
def get_all_shows():
    data = snr.get_series()
    ord_data = sorted(data,
                      key=lambda k: k['title'])  # order titles alphabetically
    list_shows(ord_data)


def get_all_episodes(show_id):
    data = snr.get_episodes_by_series_id(show_id)
    dir_show = get_appended_path(dir_shows, str(show_id))
    file_db = get_appended_path(dir_show, 'episodes.json')
    write_json(file_db, data)


params = parameters_string_to_dict(sys.argv[2])
mode = params.get('mode')
url = params.get('url')
name = params.get('name')
season = params.get('season')
episodeid = params.get('episodeid')
if type(url) == type(str()):
    url = str(url)

if mode == None:
    root()
if mode == 'getAllShows':
    get_all_shows()
elif mode == 'getShow':
    get_show(url)
elif mode == 'getSeason':
Exemplo n.º 2
0

def delete_addon(addon_id):
    xbmc.log("addon_id")
    xbmc.log(addon_id)
    name = get_addon_name(addon_id)
    line1 = TRANSLATE(30110) + ' (%s)' % name
    retval_rule = xbmcgui.Dialog().yesno("Bookmark Addon", line1)
    if retval_rule == 1:
        db_file = dir_db + addon_id + '.json'
        xbmcvfs.delete(db_file)
    xbmc.sleep(100)
    xbmc.executebuiltin("Container.Refresh")


params = parameters_string_to_dict(sys.argv[2])
mode = params.get('mode')
url = params.get('url')
if type(url) == type(str()):
    url = unquote_plus(url)


if mode == 'addons':
    get_addons()
elif mode == 'episodes':
    get_episodes(url)
elif mode == 'play':
    play(url)
elif mode == 'to_addon':
    change_addon(url)
elif mode == 'delete_entry':