Massive refactoring #1

Merged
Kharec merged 35 commits from new-architecture into main 2026-02-18 04:29:20 +01:00
Showing only changes of commit cb4104e59a - Show all commits

View File

@@ -16,16 +16,15 @@ class AppLibraryMixin:
return return
try: try:
all_items = self.library_client.fetch_all_items( all_items = self.library_client.fetch_all_items(self._thread_status_update)
self._thread_status_update)
self.call_from_thread(self.on_library_loaded, all_items) self.call_from_thread(self.on_library_loaded, all_items)
except (OSError, ValueError, KeyError) as exc: except (OSError, ValueError, KeyError) as exc:
self.call_from_thread(self.on_library_error, str(exc)) self.call_from_thread(self.on_library_error, str(exc))
def on_library_loaded(self, items: list[LibraryItem]) -> None: def on_library_loaded(self, items: list[LibraryItem]) -> None:
"""Store fetched items and refresh the active library view."""
self.all_items = items self.all_items = items
self._search_text_cache.clear() self._search_text_cache.clear()
self._prime_search_cache(items)
self.update_status(f"Loaded {len(items)} books") self.update_status(f"Loaded {len(items)} books")
if self.show_all_mode: if self.show_all_mode:
self.show_all() self.show_all()