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)
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())
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())
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'])
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'])
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)
def mark_series_watched(series_id): xbmc.executebuiltin(actions.toggle_watched()) if series_id in library_items(): library_new_episodes().remove_by(series_id)
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)