Fix impostazioni + modifiche minori
This commit is contained in:
@@ -156,7 +156,7 @@ def get_all_settings_addon():
|
||||
|
||||
|
||||
def open_settings():
|
||||
__settings__.openSettings()
|
||||
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.%s)' % PLUGIN_NAME)
|
||||
|
||||
|
||||
def get_setting(name, channel="", server="", default=None):
|
||||
|
||||
@@ -122,8 +122,9 @@ def SettingOnPosition(item):
|
||||
# This will open settings dialog focusing on fourth setting (control) inside the third category (tab)
|
||||
|
||||
import xbmc
|
||||
from platformcode import config
|
||||
|
||||
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.kod)')
|
||||
config.open_settings()
|
||||
category = item.category if item.category else 0
|
||||
setting = item.setting if item.setting else 0
|
||||
logger.debug('SETTING= ' + str(setting))
|
||||
|
||||
@@ -898,7 +898,7 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
return
|
||||
|
||||
p = 80
|
||||
progress.update(p, config.get_localized_string(20000) + '\n' + config.get_localized_string(80013))
|
||||
progress.update(p, config.get_localized_string(20000), config.get_localized_string(80013))
|
||||
|
||||
for OldFolder, NewFolder in [[old_movies_folder, new_movies_folder], [old_tvshows_folder, new_tvshows_folder]]:
|
||||
sql_old_folder = sql_old_path + OldFolder
|
||||
@@ -961,7 +961,7 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
logger.debug('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
p += 5
|
||||
progress.update(p, config.get_localized_string(20000) + '\n' + config.get_localized_string(80013))
|
||||
progress.update(p, config.get_localized_string(20000), config.get_localized_string(80013))
|
||||
|
||||
progress.update(100)
|
||||
xbmc.sleep(1000)
|
||||
|
||||
16
service.py
16
service.py
@@ -361,11 +361,7 @@ class AddonMonitor(xbmc.Monitor):
|
||||
logger.debug('settings changed')
|
||||
settings_post = config.get_all_settings_addon()
|
||||
if settings_post:
|
||||
# backup settings
|
||||
filetools.copy(os.path.join(config.get_data_path(), "settings.xml"),
|
||||
os.path.join(config.get_data_path(), "settings.bak"), True)
|
||||
logger.debug({k: self.settings_pre[k] for k in self.settings_pre
|
||||
if k in settings_post and self.settings_pre[k] != settings_post[k]})
|
||||
|
||||
from platformcode import xbmc_videolibrary
|
||||
|
||||
if self.settings_pre.get('downloadpath', None) != settings_post.get('downloadpath', None):
|
||||
@@ -402,7 +398,15 @@ class AddonMonitor(xbmc.Monitor):
|
||||
config.set_setting('elementum_on_seed', False)
|
||||
if self.settings_pre.get("shortcut_key", '') != settings_post.get("shortcut_key", ''):
|
||||
xbmc.executebuiltin('Action(reloadkeymaps)')
|
||||
self.settings_pre.update(settings_post)
|
||||
|
||||
# backup settings
|
||||
xbmc.sleep(2000)
|
||||
filetools.copy(os.path.join(config.get_data_path(), "settings.xml"),
|
||||
os.path.join(config.get_data_path(), "settings.bak"), True)
|
||||
logger.debug({k: self.settings_pre[k] for k in self.settings_pre
|
||||
if k in settings_post and self.settings_pre[k] != settings_post[k]})
|
||||
|
||||
self.settings_pre = config.get_all_settings_addon()
|
||||
|
||||
def onNotification(self, sender, method, data):
|
||||
if method == 'VideoLibrary.OnUpdate':
|
||||
|
||||
@@ -634,6 +634,7 @@ def move_videolibrary(current_path, new_path, current_movies_folder, new_movies_
|
||||
|
||||
notify = False
|
||||
progress = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80011))
|
||||
xbmc.sleep(1000)
|
||||
current_path = u'' + xbmc.translatePath(current_path)
|
||||
new_path = u'' + xbmc.translatePath(new_path)
|
||||
current_movies_path = u'' + filetools.join(current_path, current_movies_folder)
|
||||
@@ -665,7 +666,7 @@ def move_videolibrary(current_path, new_path, current_movies_folder, new_movies_
|
||||
return
|
||||
|
||||
config.verify_directories_created()
|
||||
progress.update(10, config.get_localized_string(20000) + '\n' + config.get_localized_string(80012))
|
||||
progress.update(10, config.get_localized_string(20000), config.get_localized_string(80012))
|
||||
if current_movies_path != new_movies_path:
|
||||
if filetools.listdir(current_movies_path):
|
||||
dir_util.copy_tree(current_movies_path, new_movies_path)
|
||||
|
||||
Reference in New Issue
Block a user