Skip to content

ui: recent libraries list improvements #881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/tagstudio/qt/ts_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ def remove_recent_library(self, item_key: str):

def update_libs_list(self, path: Path | str):
"""Add library to list in SettingItems.LIBS_LIST."""
item_limit: int = 5
item_limit: int = 10
path = Path(path)

self.settings.beginGroup(SettingItems.LIBS_LIST)
Expand Down Expand Up @@ -1857,8 +1857,18 @@ def open_library(self, path: Path) -> None:
open_status: LibraryStatus | None = None
try:
open_status = self.lib.open_library(path)
except ValueError as e:
logger.warning(e)
open_status = LibraryStatus(
success=False,
library_path=path,
message=Translations["menu.file.missing_library.title"],
msg_description=Translations.format(
"menu.file.missing_library.message", library=library_dir_display
),
)
except Exception as e:
logger.exception(e)
logger.error(e)
open_status = LibraryStatus(
success=False, library_path=path, message=type(e).__name__, msg_description=str(e)
)
Expand Down
2 changes: 2 additions & 0 deletions src/tagstudio/resources/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@
"menu.edit": "Edit",
"menu.file.clear_recent_libraries": "Clear Recent",
"menu.file.close_library": "&Close Library",
"menu.file.missing_library.message": "The location of the library \"{library}\" cannot be found.",
"menu.file.missing_library.title": "Missing Library",
"menu.file.new_library": "New Library",
"menu.file.open_create_library": "&Open/Create Library",
"menu.file.open_library": "Open Library",
Expand Down