From e5941b49424d622afc40d8d9d466c942ae9710f0 Mon Sep 17 00:00:00 2001 From: Jann Stute Date: Mon, 6 Jul 2026 19:13:46 +0200 Subject: [PATCH] fix(open_library): create TS directory only if not opened in memory --- src/tagstudio/core/library/alchemy/library.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/tagstudio/core/library/alchemy/library.py b/src/tagstudio/core/library/alchemy/library.py index 32d22b67..108edd09 100644 --- a/src/tagstudio/core/library/alchemy/library.py +++ b/src/tagstudio/core/library/alchemy/library.py @@ -385,19 +385,20 @@ class Library: Handles in-memory storage and checks whether a JSON-migration is necessary. """ assert isinstance(library_dir, Path) - self.verify_ts_folder(library_dir) # ensure .TagStudio directory exists sql_path = library_dir / TS_FOLDER_NAME / SQL_FILENAME json_path = library_dir / TS_FOLDER_NAME / JSON_FILENAME is_new = not sql_path.exists() - if not in_memory and is_new and json_path.exists(): - return LibraryStatus( - success=False, - library_path=library_dir, - message="[JSON] Legacy v9.4 library requires conversion to v9.5+", - json_migration_req=True, - ) + if not in_memory: + self.verify_ts_folder(library_dir) # ensure .TagStudio directory exists + if is_new and json_path.exists(): + return LibraryStatus( + success=False, + library_path=library_dir, + message="[JSON] Legacy v9.4 library requires conversion to v9.5+", + json_migration_req=True, + ) if is_new: return self.create_sqlite_library(library_dir, in_memory)