def history_delete(): if not kodi.arg('id'): return from libs.database import DB DB.execute("DELETE FROM search_history WHERE search_id=?", [kodi.arg('id')]) DB.commit() kodi.refresh()
def new_feed(): from libs.database import DB url = kodi.dialog_input('Feed URL') if not url: return DB.execute("INSERT INTO feed_subscriptions(url) VALUES(?)", [url]) DB.commit() kodi.refresh()
def delete_feed(): if not kodi.dialog_confirm('Delete Feed?', kodi.arg('title'), "Click YES to proceed."): return from libs.database import DB DB.execute("DELETE FROM feed_subscriptions WHERE feed_id=?", [kodi.arg('id')]) DB.commit() kodi.refresh()
def execute_api(): api = kodi.arg('api', decode='json') if 'confirm' in api and api['confirm']: message = api['message'] if 'message' in api else '' if not kodi.dialog_confirm("Click Yes to proceed.", api['confirm'], message): return response = core.execute_api(globals(), api) if 'notify' in api and api['notify']: kodi.notify('API Response', response) if 'refresh' in api and api['refresh']: kodi.refresh()
def uninstall_scraper(): if kodi.dialog_confirm("Click YES to proceed", "Uninstall scraper?", kodi.args['name']): scrapecore.delete_scraper(kodi.args['service']) kodi.refresh()
def toggle_scraper(): if kodi.get_setting(kodi.arg('service') + '_enable') == 'true': kodi.set_setting(kodi.arg('service') + '_enable', 'false') else: kodi.set_setting(kodi.arg('service') + '_enable', 'true') kodi.refresh()