df
This commit is contained in:
@@ -19,7 +19,7 @@ from API.HTTP import HTTPClient
|
||||
from ProviderCore.base import SearchProvider, SearchResult
|
||||
from ProviderCore.download import download_file, sanitize_filename
|
||||
from cli_syntax import get_field, get_free_text, parse_query
|
||||
from SYS.logger import log
|
||||
from SYS.logger import debug, log
|
||||
from SYS.utils import unique_path
|
||||
|
||||
try:
|
||||
@@ -564,7 +564,7 @@ class OpenLibrary(SearchProvider):
|
||||
if val:
|
||||
new_tags.append(f"{ns}:{val}")
|
||||
|
||||
log(f"Found {len(new_tags)} tag(s) from ISBN lookup")
|
||||
debug(f"Found {len(new_tags)} tag(s) from ISBN lookup")
|
||||
return new_tags
|
||||
|
||||
@staticmethod
|
||||
@@ -703,7 +703,7 @@ class OpenLibrary(SearchProvider):
|
||||
if isinstance(ocaid, str) and ocaid.strip():
|
||||
new_tags.append(f"internet_archive:{ocaid.strip()}")
|
||||
|
||||
log(f"Found {len(new_tags)} tag(s) from OpenLibrary lookup")
|
||||
debug(f"Found {len(new_tags)} tag(s) from OpenLibrary lookup")
|
||||
return new_tags
|
||||
|
||||
def search(
|
||||
@@ -788,7 +788,6 @@ class OpenLibrary(SearchProvider):
|
||||
|
||||
availability_rows: List[Tuple[str, str, str, str]] = [("unknown", "", "", "") for _ in range(len(docs))]
|
||||
if docs:
|
||||
log(f"[openlibrary] Enriching availability for {len(docs)} result(s)...")
|
||||
max_workers = min(8, max(1, len(docs)))
|
||||
done = 0
|
||||
with futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
|
||||
@@ -804,9 +803,7 @@ class OpenLibrary(SearchProvider):
|
||||
except Exception:
|
||||
availability_rows[i] = ("unknown", "", "", "")
|
||||
done += 1
|
||||
if done in {1, len(future_to_index)} or (done % 10 == 0):
|
||||
log(f"[openlibrary] Availability: {done}/{len(future_to_index)}")
|
||||
log("[openlibrary] Availability enrichment complete")
|
||||
|
||||
|
||||
for idx, doc in enumerate(docs):
|
||||
if not isinstance(doc, dict):
|
||||
|
||||
Reference in New Issue
Block a user