fix mancata chiusura db
This commit is contained in:
@@ -24,6 +24,10 @@ class nested_dict_sqlite(defaultdict):
|
|||||||
self[key] = value = self.default_factory(key)
|
self[key] = value = self.default_factory(key)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
for key in self.keys():
|
||||||
|
self[key].close()
|
||||||
|
|
||||||
|
|
||||||
db_name = filetools.join(config.get_data_path(), "db.sqlite")
|
db_name = filetools.join(config.get_data_path(), "db.sqlite")
|
||||||
db = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))
|
db = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))
|
||||||
|
|||||||
@@ -343,6 +343,10 @@ def run(item=None):
|
|||||||
if platformtools.dialog_yesno(config.get_localized_string(60038), config.get_localized_string(60015)):
|
if platformtools.dialog_yesno(config.get_localized_string(60038), config.get_localized_string(60015)):
|
||||||
run(Item(channel="setting", action="report_menu"))
|
run(Item(channel="setting", action="report_menu"))
|
||||||
|
|
||||||
|
# close db to ensure his thread will stop
|
||||||
|
from core import db
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
|
||||||
def new_search(item, channel=None):
|
def new_search(item, channel=None):
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
|
|||||||
@@ -673,11 +673,11 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
|||||||
|
|
||||||
# Open the selection dialog to see the available options
|
# Open the selection dialog to see the available options
|
||||||
opciones, video_urls, seleccion, salir = get_dialogo_opciones(item, default_action, strm, autoplay)
|
opciones, video_urls, seleccion, salir = get_dialogo_opciones(item, default_action, strm, autoplay)
|
||||||
if salir: exit()
|
if salir: return
|
||||||
|
|
||||||
# get default option of addon configuration
|
# get default option of addon configuration
|
||||||
seleccion = get_seleccion(default_action, opciones, seleccion, video_urls)
|
seleccion = get_seleccion(default_action, opciones, seleccion, video_urls)
|
||||||
if seleccion < 0: exit() # Canceled box
|
if seleccion < 0: return # Canceled box
|
||||||
|
|
||||||
logger.debug("selection=%d" % seleccion)
|
logger.debug("selection=%d" % seleccion)
|
||||||
logger.debug("selection=%s" % opciones[seleccion])
|
logger.debug("selection=%s" % opciones[seleccion])
|
||||||
|
|||||||
Reference in New Issue
Block a user