From 6c9a22d56635c3110e11df4517c8af6bdd5b5e7e Mon Sep 17 00:00:00 2001 From: Psychokiller1888 Date: Wed, 18 Dec 2019 17:42:19 +0100 Subject: [PATCH] Fix double assistant download procedure --- core/snips/SamkillaManager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/snips/SamkillaManager.py b/core/snips/SamkillaManager.py index 129c5b438..9260e9f78 100755 --- a/core/snips/SamkillaManager.py +++ b/core/snips/SamkillaManager.py @@ -130,12 +130,13 @@ def sync(self, skillFilter: dict = None, download: bool = True) -> bool: self.log('Changes detected during sync but not downloading yet') else: self.log('No changes detected during sync') - self.SkillManager.onSnipsAssistantDownloaded(skillsInfos=skillFilter) - self.stop() + if not Path(self.Commons.rootDir(), f'trained/assistants/assistant_{self.LanguageManager.activeLanguage}').exists(): + self.SnipsConsoleManager.doDownload() + else: + self.SkillManager.onSnipsAssistantDownloaded(skillsInfos=skillFilter) - if not Path(self.Commons.rootDir(), f'trained/assistants/assistant_{self.LanguageManager.activeLanguage}').exists(): - self.SnipsConsoleManager.doDownload() + self.stop() except AssistantNotFoundError: self.log(f'Assistant project id \'{activeProjectId}\' for lang \'{activeLang}\' doesn\'t exist. Check your config.py')