def turn_off_auto_refresh(section, media_id):
    section = Section.find(section)
    scraper = container.scraper()
    scraper.get_details_cached(section, media_id)
    scraper.get_folders_cached(section, media_id)
    container.details_cache().protect_item(media_id)
    container.folders_cache().protect_item(media_id)
    not_refreshing_items = container.not_refreshing_items()
    not_refreshing_items[media_id] = True
    plugin.refresh()
def turn_on_auto_refresh(section, media_id):
    try:
        container.details_cache().unprotect_item(media_id)
    except KeyError:
        pass
    try:
        container.folders_cache().unprotect_item(media_id)
    except KeyError:
        pass
    not_refreshing_items = container.not_refreshing_items()
    if media_id in not_refreshing_items:
        del not_refreshing_items[media_id]
    plugin.refresh()
def refresh(media_id):
    details_cache = container.details_cache()
    folders_cache = container.folders_cache()
    meta_cache = container.meta_cache()
    if media_id in details_cache:
        del(details_cache[media_id])
    if media_id in folders_cache:
        del(folders_cache[media_id])
    if media_id in meta_cache:
        del(meta_cache[media_id])
    plugin.refresh()
def refresh_all():
    container.details_cache().clear()
    container.folders_cache().clear()
    container.meta_cache().clear()
    container.search_cache().clear()
    plugin.refresh()