Пример #1
0
def toggle_episode_watched(series_id, season, episode):
    xbmc.executebuiltin(actions.toggle_watched())
    if plugin.get_setting('sync_mark_watch', bool):
        scraper = get_scraper()
        scraper.api.mark_watched(series_id, season, episode, mode='on')
    if series_id in library_items():
        library_new_episodes().remove_by(series_id, season, episode)
Пример #2
0
def add_to_library(series_id):
    items = library_items()
    scraper = get_scraper()
    if series_id not in items:
        items.append(series_id)
        if plugin.get_setting('sync_add_remove_favorite', bool):
            scraper.api.favorite(series_id)
    plugin.set_setting('update-library', True)
    xbmc.executebuiltin(actions.refresh())
Пример #3
0
def remove_from_library(series_id):
    items = library_items()
    scraper = get_scraper()
    if series_id in items:
        items.remove(series_id)
        if plugin.get_setting('sync_add_remove_favorite', bool):
            scraper.api.favorite(series_id)
    library_new_episodes().remove_by(series_id=series_id)
    plugin.set_setting('update-library', True)
    xbmc.executebuiltin(actions.refresh())
Пример #4
0
def browse_library():
    plugin.set_content('tvshows')
    scraper = get_scraper()
    library = library_items()
    total = len(library)
    for batch_ids in batch(library, BATCH_SERIES_COUNT):
        if abort_requested():
            break
        series = scraper.get_series_bulk(batch_ids)
        items = [itemify_series(series[i], highlight_library_items=False) for i in batch_ids]
        plugin.add_items(with_fanart(items), total)
    plugin.finish(sort_methods=['unsorted', 'label'])
Пример #5
0
def browse_library():
    plugin.set_content('tvshows')
    scraper = get_scraper()
    library = library_items()
    total = len(library)
    for batch_ids in batch(library, BATCH_SERIES_COUNT):
        if abort_requested():
            break
        series = scraper.get_series_bulk(batch_ids)
        items = [
            itemify_series(series[i], highlight_library_items=False)
            for i in batch_ids
        ]
        plugin.add_items(with_fanart(items), total)
    plugin.finish(sort_methods=['unsorted', 'label'])
Пример #6
0
def add_to_library(series_id):
    items = library_items()
    if series_id not in items:
        items.append(series_id)
    plugin.set_setting('update-library', True)
Пример #7
0
def mark_series_watched(series_id):
    xbmc.executebuiltin(actions.toggle_watched())
    if series_id in library_items():
        library_new_episodes().remove_by(series_id)
Пример #8
0
def remove_from_library(series_id):
    items = library_items()
    if series_id in items:
        items.remove(series_id)
    library_new_episodes().remove_by(series_id=series_id)
    plugin.set_setting('update-library', True)
Пример #9
0
def add_to_library(series_id):
    items = library_items()
    if series_id not in items:
        items.append(series_id)
    plugin.set_setting('update-library', True)
Пример #10
0
def mark_series_watched(series_id):
    xbmc.executebuiltin(actions.toggle_watched())
    if series_id in library_items():
        library_new_episodes().remove_by(series_id)
Пример #11
0
def remove_from_library(series_id):
    items = library_items()
    if series_id in items:
        items.remove(series_id)
    library_new_episodes().remove_by(series_id=series_id)
    plugin.set_setting('update-library', True)