This commit is contained in:
nose
2025-12-11 19:04:02 -08:00
parent 6863c6c7ea
commit 16d8a763cd
103 changed files with 4759 additions and 9156 deletions

View File

@@ -16,7 +16,7 @@ import asyncio
sys.path.insert(0, str(Path(__file__).parent.parent))
from config import load_config
from result_table import ResultTable
from helper.provider import get_provider
from Provider.registry import get_search_provider
logger = logging.getLogger(__name__)
@@ -158,7 +158,7 @@ class SearchModal(ModalScreen):
self.current_worker.log_step(f"Connecting to {source}...")
try:
provider = get_provider(source)
provider = get_search_provider(source)
if not provider:
logger.error(f"[search-modal] Provider not available: {source}")
if self.current_worker:
@@ -282,7 +282,7 @@ class SearchModal(ModalScreen):
# Handle both SearchResult objects and dicts
if hasattr(result, 'full_metadata'):
metadata = result.full_metadata or {}
source = result.origin
source = result.table
title = result.title
else:
# Handle dict (legacy or from to_dict)
@@ -293,7 +293,7 @@ class SearchModal(ModalScreen):
else:
metadata = result
source = result.get('origin', result.get('source', ''))
source = result.get('table', '')
title = result.get('title', '')
# Format tags based on result source
@@ -332,7 +332,7 @@ class SearchModal(ModalScreen):
async def _download_book(self, result: Any) -> None:
"""Download a book from OpenLibrary using unified downloader."""
try:
from helper.unified_book_downloader import UnifiedBookDownloader
from Provider.unified_book_downloader import UnifiedBookDownloader
from config import load_config
# Convert SearchResult to dict if needed