From fc76738fc57cad11d98a7cadb2b334baf345fda0 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sun, 9 Aug 2015 18:09:23 +0300 Subject: [PATCH] tmp fix --- Core.py | 6 ++++-- functions.py | 11 +++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Core.py b/Core.py index 753b6a5..afda5b7 100644 --- a/Core.py +++ b/Core.py @@ -48,16 +48,18 @@ class Core: def __init__(self): print '!!!!!!!!!!!!!!!!!! BORN '+self.__class__.__name__ - if 0 == len(self.userStorageDirectory): - download_dir = download_dir_check() + if len(self.userStorageDirectory) == 0: + download_dir = get_download_dir() else: download_dir = self.userStorageDirectory self.userStorageDirectory = os.path.join(download_dir, 'Torrenter') def sectionMenu(self): if self.__settings__.getSetting('plugin_name')!=self.__plugin__: + #Every update run self.__settings__.setSetting('plugin_name',self.__plugin__) check_network_advancedsettings() + check_download_dir() if self.__plugin__ == 'Torrenter v.2.3.7': #first_run_231() pass diff --git a/functions.py b/functions.py index 584ae88..25513a4 100644 --- a/functions.py +++ b/functions.py @@ -1821,7 +1821,7 @@ def check_network_advancedsettings(): else: print 'UPDATE advancedsettings.xml disabled by user!' -def download_dir_check(): +def get_download_dir(): from platform_pulsar import get_platform import tempfile platform = get_platform() @@ -1838,4 +1838,11 @@ def download_dir_check(): download_dir = tempdir() except: download_dir = tempdir() - return download_dir \ No newline at end of file + return download_dir + +def check_download_dir(): + if len(__settings__.getSetting("storage"))==0: + dialog=xbmcgui.Dialog() + dialog.ok(Localization.localize('Torrenter'), + Localization.localize('Please specify storage folder in Settings!')) + __settings__.openSettings()