fix mancata chiusura db ed errore in caso di annullamento aggiunta film in videoteca
This commit is contained in:
+10
-11
@@ -1007,21 +1007,20 @@ def add_movie(item):
|
|||||||
# If you do it in "Enter another name", TMDB will automatically search for the new title
|
# If you do it in "Enter another name", TMDB will automatically search for the new title
|
||||||
# If you do it in "Complete Information", it partially changes to the new title, but does not search TMDB. We have to do it
|
# If you do it in "Complete Information", it partially changes to the new title, but does not search TMDB. We have to do it
|
||||||
# If the second screen is canceled, the variable "scraper_return" will be False. The user does not want to continue
|
# If the second screen is canceled, the variable "scraper_return" will be False. The user does not want to continue
|
||||||
|
|
||||||
item = generictools.update_title(item) # We call the method that updates the title with tmdb.find_and_set_infoLabels
|
item = generictools.update_title(item) # We call the method that updates the title with tmdb.find_and_set_infoLabels
|
||||||
#if item.tmdb_stat:
|
#if item.tmdb_stat:
|
||||||
# del item.tmdb_stat # We clean the status so that it is not recorded in the Video Library
|
# del item.tmdb_stat # We clean the status so that it is not recorded in the Video Library
|
||||||
# if item:
|
if item:
|
||||||
new_item = item.clone(action="findvideos")
|
new_item = item.clone(action="findvideos")
|
||||||
insertados, sobreescritos, fallidos, path = save_movie(new_item)
|
insertados, sobreescritos, fallidos, path = save_movie(new_item)
|
||||||
|
|
||||||
if fallidos == 0:
|
if fallidos == 0:
|
||||||
platformtools.dialog_ok(config.get_localized_string(30131),
|
platformtools.dialog_ok(config.get_localized_string(30131),
|
||||||
config.get_localized_string(30135) % new_item.contentTitle) # 'has been added to the video library'
|
config.get_localized_string(30135) % new_item.contentTitle) # 'has been added to the video library'
|
||||||
else:
|
else:
|
||||||
filetools.rmdirtree(path)
|
filetools.rmdirtree(path)
|
||||||
platformtools.dialog_ok(config.get_localized_string(30131),
|
platformtools.dialog_ok(config.get_localized_string(30131),
|
||||||
config.get_localized_string(60066) % new_item.contentTitle) # "ERROR, the movie has NOT been added to the video library")
|
config.get_localized_string(60066) % new_item.contentTitle) # "ERROR, the movie has NOT been added to the video library")
|
||||||
|
|
||||||
|
|
||||||
def add_tvshow(item, channel=None):
|
def add_tvshow(item, channel=None):
|
||||||
|
|||||||
@@ -342,6 +342,10 @@ def run(item=None):
|
|||||||
else:
|
else:
|
||||||
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"))
|
||||||
|
finally:
|
||||||
|
if not item.action.startswith('play'):
|
||||||
|
from core import db
|
||||||
|
db.close()
|
||||||
|
|
||||||
|
|
||||||
def new_search(item, channel=None):
|
def new_search(item, channel=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user