Exemple #1
0
def feed_menu():
    from libs.database import DB
    kodi.add_menu_item({'mode': 'new_feed'},
                       {'title': "*** New Search Feed ***"},
                       icon='null')
    feeds = DB.query_assoc(
        "SELECT feed_id, name, url, enabled FROM feed_subscriptions")
    for feed in feeds:
        menu = kodi.ContextMenu()

        name = feed['name'] if feed['name'] else feed['url']
        if not feed['enabled']:
            title = "[COLOR darkred]%s[/COLOR]" % name
        else:
            title = name
        menu.add('Delete Feed', {
            "mode": "delete_feed",
            "title": title,
            "id": feed['feed_id']
        })
        kodi.add_menu_item({
            'mode': 'list_feed',
            'url': feed['url']
        }, {'title': title},
                           menu=menu,
                           icon='null')
    kodi.eod()
Exemple #2
0
def search_menu():
	from libs.database import DB
	kodi.add_menu_item({'mode': 'void'}, {'title': "[COLOR darkorange]%s[/COLOR]" % kodi.arg('title')}, icon='null')
	kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type')}, {'title': "*** New Search ***"}, icon='null')
	results = DB.query_assoc("SELECT search_id, query FROM search_history WHERE search_type=? ORDER BY ts DESC LIMIT 10", [kodi.arg('type')], silent=True)
	if results is not None:
		for result in results:
			menu = kodi.ContextMenu()
			menu.add('Delete from search history', {"mode": "history_delete", "id": result['search_id']})
			kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type'), 'query': result['query']}, {'title': result['query']}, menu=menu, icon='null')
	kodi.eod()
def search_menu():
	from libs.database import DB
	kodi.add_menu_item({'mode': 'void'}, {'title': "[COLOR darkorange]%s[/COLOR]" % kodi.arg('title')}, icon='null')
	kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type')}, {'title': "*** New Search ***"}, icon='null')
	results = DB.query_assoc("SELECT search_id, query FROM search_history WHERE search_type=? ORDER BY ts DESC LIMIT 10", [kodi.arg('type')], silent=True)
	if results is not None:
		for result in results:
			menu = kodi.ContextMenu()
			menu.add('Delete from search history', {"mode": "history_delete", "id": result['search_id']})
			kodi.add_menu_item({'mode': 'search', 'type': kodi.arg('type'), 'query': result['query']}, {'title': result['query']}, menu=menu, icon='null')
	kodi.eod()
Exemple #4
0
def feed_menu():
	from libs.database import DB
	kodi.add_menu_item({'mode': 'install_local_feed'}, {'title': "*** Local Search Feed File ***"}, icon='install_feed_local.png')
	#kodi.add_menu_item({'mode': 'search', 'query': 'gitbrowser.feed', 'type': 'addonid'}, {'title': "*** Search for Feeds ***"}, icon='null')
	feeds = DB.query_assoc("SELECT feed_id, name, url, enabled FROM feed_subscriptions")
	for feed in feeds:
		menu = kodi.ContextMenu()
		
		name = feed['name'] if feed['name'] else feed['url']
		if not feed['enabled']:
			title = "[COLOR darkred]%s[/COLOR]" % name
		else: title = name
		menu.add('Delete Feed', {"mode": "delete_feed", "title": title, "id": feed['feed_id']})
		kodi.add_menu_item({'mode': 'list_feed', 'url': feed['url']}, {'title': title}, menu=menu, icon='null')
	kodi.eod()
Exemple #5
0
def feed_menu():
	from libs.database import DB
	kodi.add_menu_item({'mode': 'install_local_feed'}, {'title': "*** Local Search Feed File ***"}, icon='install_feed_local.png')
	#kodi.add_menu_item({'mode': 'search', 'query': 'gitbrowser.feed', 'type': 'addonid'}, {'title': "*** Search for Feeds ***"}, icon='null')
	feeds = DB.query_assoc("SELECT feed_id, name, url, enabled FROM feed_subscriptions")
	for feed in feeds:
		menu = kodi.ContextMenu()
		
		name = feed['name'] if feed['name'] else feed['url']
		if not feed['enabled']:
			title = "[COLOR darkred]%s[/COLOR]" % name
		else: title = name
		menu.add('Delete Feed', {"mode": "delete_feed", "title": title, "id": feed['feed_id']})
		kodi.add_menu_item({'mode': 'list_feed', 'url': feed['url']}, {'title': title}, menu=menu, icon='null')
	kodi.eod()