This commit is contained in:
2026-01-23 00:24:00 -08:00
parent a329299b3c
commit 072edb4399
3 changed files with 166 additions and 100 deletions

View File

@@ -25,6 +25,7 @@ from pathlib import Path
from typing import Any, Dict, List, Optional, Sequence, Tuple
from SYS import pipeline as ctx
from SYS.pipeline_progress import PipelineProgress
from . import _shared as sh
normalize_hash = sh.normalize_hash
@@ -573,6 +574,16 @@ def _emit_tag_payload(
return 0
def _finalize_pipeline_progress() -> None:
"""Ensure the pipeline UI shows the stage as complete."""
try:
progress = PipelineProgress(ctx)
progress.clear_status()
progress.set_percent(100)
except Exception:
pass
def _extract_scrapable_identifiers(tags_list: List[str]) -> Dict[str, str]:
"""Extract scrapable identifiers from tags."""
identifiers = {}
@@ -979,15 +990,23 @@ def _run(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
"""Get tags from Hydrus, local sidecar, or URL metadata.
Usage:
get-tag [-query "hash:<sha256>"] [--store <key>] [--emit]
get-tag -scrape <url|provider>
get-tag [-query "hash:<sha256>"] [--store <key>] [--emit]
get-tag -scrape <url|provider>
Options:
-query "hash:<sha256>": Override hash to use instead of result's hash
--store <key>: Store result to this key for pipeline
--emit: Emit result without interactive prompt (quiet mode)
-scrape <url|provider>: Scrape metadata from URL or provider name (itunes, openlibrary, googlebooks, imdb)
-query "hash:<sha256>": Override hash to use instead of result's hash
--store <key>: Store result to this key for pipeline
--emit: Emit result without interactive prompt (quiet mode)
-scrape <url|provider>: Scrape metadata from URL or provider name (itunes, openlibrary, googlebooks, imdb)
"""
try:
return _run_impl(result, args, config)
finally:
_finalize_pipeline_progress()
def _run_impl(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
"""Internal implementation details for get-tag."""
emit_mode = False
is_store_backed = False
args_list = [str(arg) for arg in (args or [])]