diff --git a/ordigi/collection.py b/ordigi/collection.py index 7318e3b..ef099c9 100644 --- a/ordigi/collection.py +++ b/ordigi/collection.py @@ -427,7 +427,11 @@ class Paths: default=self.paths_list, ), ] - return inquirer.prompt(questions, theme=self.theme)['selection'] + prompt = inquirer.prompt(questions, theme=self.theme) + if prompt: + return prompt['selection'] + + sys.exit() def get_paths_list(self, path): self.paths_list = list(self.get_files(path)) diff --git a/ordigi/media.py b/ordigi/media.py index 09d8ae1..cb8a77d 100644 --- a/ordigi/media.py +++ b/ordigi/media.py @@ -301,9 +301,11 @@ class Media(ReadExif): default=default, ), ] - # import ipdb; ipdb.set_trace() answers = inquirer.prompt(choices_list, theme=self.theme) + if not answers: + sys.exit() + if not answers['date_list']: prompt = [ inquirer.Text('date_custom', message="date"), @@ -414,6 +416,9 @@ class Media(ReadExif): ] answers = inquirer.prompt(choices_list, theme=self.theme) + if not answers: + sys.exit() + if not answers['album']: answers = inquirer.prompt(prompt, theme=self.theme) return answers['custom']