From f403bb81e2d3398b01d0bc3e0afd37555ad73b02 Mon Sep 17 00:00:00 2001 From: python357-1 Date: Tue, 24 Dec 2024 01:03:21 -0600 Subject: [PATCH 1/3] fix: fix -o flag not working if path has whitespace around it --- tagstudio/src/qt/ts_qt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tagstudio/src/qt/ts_qt.py b/tagstudio/src/qt/ts_qt.py index 4a568b578..545a730b6 100644 --- a/tagstudio/src/qt/ts_qt.py +++ b/tagstudio/src/qt/ts_qt.py @@ -468,7 +468,7 @@ def create_folders_tags_modal(): self.init_library_window() self.migration_modal: JsonMigrationModal = None - path_result = self.evaluate_path(self.args.open) + path_result = self.evaluate_path(str(self.args.open).strip()) # check status of library path evaluating if path_result.success and path_result.library_path: self.splash.showMessage( From e7f123ee5c13bfea71a26394f41a4abf385205f9 Mon Sep 17 00:00:00 2001 From: python357-1 Date: Tue, 24 Dec 2024 02:10:05 -0600 Subject: [PATCH 2/3] fix: change strip to lstrip/rstrip --- tagstudio/src/qt/ts_qt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tagstudio/src/qt/ts_qt.py b/tagstudio/src/qt/ts_qt.py index 545a730b6..6e2676573 100644 --- a/tagstudio/src/qt/ts_qt.py +++ b/tagstudio/src/qt/ts_qt.py @@ -468,7 +468,7 @@ def create_folders_tags_modal(): self.init_library_window() self.migration_modal: JsonMigrationModal = None - path_result = self.evaluate_path(str(self.args.open).strip()) + path_result = self.evaluate_path(str(self.args.open).lstrip().rstrip()) # check status of library path evaluating if path_result.success and path_result.library_path: self.splash.showMessage( From 752592ed18b740a21981d69fb45d378d7ed62413 Mon Sep 17 00:00:00 2001 From: python357-1 Date: Sat, 28 Dec 2024 14:23:58 -0600 Subject: [PATCH 3/3] fix: manually expand "~" --- tagstudio/src/core/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tagstudio/src/core/driver.py b/tagstudio/src/core/driver.py index 1561fbc92..1f7dd4f79 100644 --- a/tagstudio/src/core/driver.py +++ b/tagstudio/src/core/driver.py @@ -16,7 +16,7 @@ def evaluate_path(self, open_path: str | None) -> LibraryStatus: """Check if the path of library is valid.""" library_path: Path | None = None if open_path: - library_path = Path(open_path) + library_path = Path(open_path).expanduser() if not library_path.exists(): logger.error("Path does not exist.", open_path=open_path) return LibraryStatus(success=False, message="Path does not exist.")