Example #1
0
def lists_trakt_add_my_lists_to_library():
    misc_ids = []
    movie_ids = []
    tv_ids = []
    import xbmcgui
    lists = trakt.trakt_get_lists()
    dialogs.notify(msg='Adding ' + str(len(lists)) + " lists",
                   title='to Kodi library',
                   delay=3000,
                   image=get_icon_path("chappaai"))
    for list in lists:
        user = list["user"]["username"]
        slug = list["ids"]["slug"]
        items = lists_trakt_show_list(user, slug)
        list_misc_ids, list_movie_ids, list_tv_ids = batch_find_list_ids(items)
        write_list_id_files(list_misc_ids, list_tv_ids, list_movie_ids, slug,
                            user)
        misc_ids.extend(list_misc_ids)
        movie_ids.extend(list_movie_ids)
        tv_ids.extend(list_tv_ids)
    write_batch_id_files(tv_ids, movie_ids, misc_ids)
    dialogs.notify(msg='Generating',
                   title='.strm-files',
                   delay=3000,
                   image=get_icon_path("chappaai"))
    xbmc.executebuiltin(
        "RunPlugin(plugin://plugin.video.chappaai/movies/batch_add_to_library)"
    )
Example #2
0
def lists_trakt_my_lists():
    lists = trakt.trakt_get_lists()
    items = []
    for list in lists:
        name = list["name"]
        user = list["user"]["username"]
        slug = list["ids"]["slug"]
        items.append({
            'label':
            name,
            'path':
            plugin.url_for("lists_trakt_show_list", user=user, slug=slug),
            'context_menu':
            [(_("Scan item to library"), "RunPlugin({0})".format(
                plugin.url_for("lists_trakt_add_all_to_library",
                               user=user,
                               slug=slug))),
             ("{0} ({1})".format(_("Play"),
                                 _("Random").lower()), "RunPlugin({0})".format(
                                     plugin.url_for("lists_trakt_play_random",
                                                    user=user,
                                                    slug=slug)))],
            'icon':
            get_icon_path("traktmylists"),
            'thumbnail':
            get_icon_path("traktmylists"),
        })
        fanart = plugin.addon.getAddonInfo('fanart')
        for item in items:
            item['properties'] = {'fanart_image': get_background_path()}
    if FORCE == True:
        return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
    else:
        return plugin.finish(items=items, sort_methods=SORT)
Example #3
0
def lists_trakt_my_lists():
    lists = trakt.trakt_get_lists()
    items = []
    for list in lists:
        name = list["name"]
        user = list["user"]["username"]
        slug = list["ids"]["slug"]
        items.append({
            'label': name,
            'path': plugin.url_for("lists_trakt_show_list", user = user, slug = slug),
            'context_menu': [
                (
                    _("Scan item to library"),
                    "RunPlugin({0})".format(plugin.url_for("lists_trakt_add_all_to_library", user=user, slug=slug))
                ),
                (
                    "{0} ({1})".format(_("Play"), _("Random").lower()),
                    "RunPlugin({0})".format(plugin.url_for("lists_trakt_play_random", user=user, slug=slug))
                )
            ],
            'icon': get_icon_path("traktmylists"),
            'thumbnail': get_icon_path("traktmylists"),
        })
        fanart = plugin.addon.getAddonInfo('fanart')
        for item in items:
            item['properties'] = {'fanart_image' : get_background_path()}
    if FORCE == True: return plugin.finish(items=items, sort_methods=SORT, view_mode=VIEW)
    else: return plugin.finish(items=items, sort_methods=SORT)
Example #4
0
def lists_trakt_my_lists():
    lists = trakt.trakt_get_lists()
    items = []
    for list in lists:
        name = list["name"]
        user = list["user"]["username"]
        slug = list["ids"]["slug"]
        items.append({
            'label': name,
            'path': plugin.url_for(lists_trakt_show_list, user = user, slug = slug),
            'icon': get_icon_path("traktmylists"),
        })
    return sorted(items,key = lambda item: item["label"])
Example #5
0
def get_list_selection():
    trakt_lists = trakt.trakt_get_lists()
    my_lists = []
    for list in trakt_lists:
        my_lists.append({
            'name': list["name"],
            'user': list["user"]["username"],
            'slug': list["ids"]["slug"]
        })
    selection = dialogs.select(_("Select list"), [l["name"] for l in my_lists])
    if selection >= 0:
        return my_lists[selection]
    return None
Example #6
0
def lists_trakt_add_my_lists_to_library():
    misc_ids = []
    movie_ids = []
    tv_ids = []
    import xbmcgui
    lists = trakt.trakt_get_lists()
    dialogs.notify(msg='Adding ' + str(len(lists)) + " lists", title='to Kodi library', delay=3000, image=get_icon_path("metalliq"))
    for list in lists:
        user = list["user"]["username"]
        slug = list["ids"]["slug"]
        items = lists_trakt_show_list(user, slug)
        list_misc_ids, list_movie_ids, list_tv_ids = batch_find_list_ids(items)
        write_list_id_files(list_misc_ids, list_tv_ids, list_movie_ids, slug, user)
        misc_ids.extend(list_misc_ids)
        movie_ids.extend(list_movie_ids)
        tv_ids.extend(list_tv_ids)
    write_batch_id_files(tv_ids, movie_ids, misc_ids)
    dialogs.notify(msg='Generating', title='.strm-files', delay=3000, image=get_icon_path("metalliq"))
    xbmc.executebuiltin("RunPlugin(plugin://plugin.video.metalliq/movies/batch_add_to_library)")