From d19610208e660eb4f73795452f6b02ba60e4256e Mon Sep 17 00:00:00 2001 From: brookite Date: Tue, 6 Sep 2022 23:15:50 +0300 Subject: [PATCH] Fixed directory finding in Add books dialog --- app/appinfo.py | 2 +- app/window.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/appinfo.py b/app/appinfo.py index 342aa06..dccb94d 100644 --- a/app/appinfo.py +++ b/app/appinfo.py @@ -1,2 +1,2 @@ VERSION_NAME = "1.0 RC1" -BUILD_NUMBER = 1143 \ No newline at end of file +BUILD_NUMBER = 1144 \ No newline at end of file diff --git a/app/window.py b/app/window.py index c68d213..8c5c9df 100644 --- a/app/window.py +++ b/app/window.py @@ -277,7 +277,12 @@ def import_backup(self): self.close() def add_books(self): - default_dir = "" if len(self.settings.book_paths) == 0 else self.settings.book_paths[0] + default_dir = "" + for directory in self.settings.book_paths: + if os.path.isdir(directory): + default_dir = directory + break + filenames = QFileDialog.getOpenFileNames( self, tr("Adding books"), default_dir, SUPPORTED_FORMATS_NAMES