Skip to content

[Bug]: "Open Library on Start" not working #725

Closed
@Tishj

Description

@Tishj

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

main

Operating System & Version

Windows 10

Description

No library is loaded on start

diff --git a/tagstudio/src/qt/ts_qt.py b/tagstudio/src/qt/ts_qt.py
index 046e934..86f871d 100644
--- a/tagstudio/src/qt/ts_qt.py
+++ b/tagstudio/src/qt/ts_qt.py
@@ -512,7 +512,12 @@ class QtDriver(DriverMixin, QObject):
         self.init_library_window()
         self.migration_modal: JsonMigrationModal = None

-        path_result = self.evaluate_path(str(self.args.open).lstrip().rstrip())
+        library_path = str(self.args.open).lstrip().rstrip()
+        last_library = self.settings.value(SettingItems.LAST_LIBRARY)
+        if last_library:
+            library_path = last_library
+
+        path_result = self.evaluate_path(library_path)
         if path_result.success and path_result.library_path:
             self.open_library(path_result.library_path)

This isn't respecting START_LOAD_LAST yet, but it gets the job done

Expected Behavior

The last used library should be loaded when the application is started

Steps to Reproduce

  1. Open a library
  2. Close the app
  3. Reopen the app
  4. The last library should open - it doesn't

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: HighAn important issue requiring attentionType: BugSomething isn't working as intended

    Type

    No type

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions