update and cleanup repo
This commit is contained in:
@@ -640,8 +640,8 @@ def _run(result: Any, _args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
except Exception:
|
||||
hydrus_client = None
|
||||
|
||||
# Sidecar/tag import fallback DB root (legacy): if a folder store is selected, use it;
|
||||
# otherwise fall back to configured local storage path.
|
||||
# Use the selected store root when available; otherwise use the configured
|
||||
# local plugin root for sidecar/tag import lookup.
|
||||
from SYS.config import get_local_storage_path
|
||||
|
||||
local_storage_root: Optional[Path] = None
|
||||
@@ -852,8 +852,8 @@ def _run(result: Any, _args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
"path",
|
||||
None)
|
||||
|
||||
# Legacy LOCAL STORAGE MODE: Handle relationships for local files
|
||||
# (kept as stub - folder store removed)
|
||||
# Handle relationships for local-file results using the configured
|
||||
# local plugin root when available.
|
||||
from SYS.config import get_local_storage_path
|
||||
|
||||
local_storage_path = get_local_storage_path(config) if config else None
|
||||
@@ -869,7 +869,7 @@ def _run(result: Any, _args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
try:
|
||||
file_path_obj = Path(str(file_path_from_result))
|
||||
except Exception as exc:
|
||||
log(f"Local storage error: {exc}", file=sys.stderr)
|
||||
log(f"Local library error: {exc}", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
if not file_path_obj.exists():
|
||||
@@ -879,12 +879,12 @@ def _run(result: Any, _args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
if file_path_obj is not None:
|
||||
try:
|
||||
if local_storage_root is None:
|
||||
log("Local storage path unavailable", file=sys.stderr)
|
||||
log("Local plugin path unavailable", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
with LocalLibrarySearchOptimizer(local_storage_root) as opt:
|
||||
if opt.db is None:
|
||||
log("Local storage DB unavailable", file=sys.stderr)
|
||||
log("Local library DB unavailable", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
if king_hash:
|
||||
|
||||
@@ -25,7 +25,7 @@ expand_tag_groups = sh.expand_tag_groups
|
||||
merge_sequences = sh.merge_sequences
|
||||
render_tag_value_templates = sh.render_tag_value_templates
|
||||
parse_cmdlet_args = sh.parse_cmdlet_args
|
||||
collapse_namespace_tag = sh.collapse_namespace_tag
|
||||
collapse_namespace_tags = sh.collapse_namespace_tags
|
||||
should_show_help = sh.should_show_help
|
||||
get_field = sh.get_field
|
||||
|
||||
@@ -800,7 +800,7 @@ class Add_Tag(Cmdlet):
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
item_tag_to_add = collapse_namespace_tag(
|
||||
item_tag_to_add = collapse_namespace_tags(
|
||||
item_tag_to_add,
|
||||
"title",
|
||||
prefer="last"
|
||||
@@ -843,7 +843,7 @@ class Add_Tag(Cmdlet):
|
||||
)
|
||||
unresolved_template_count += len(unresolved_templates)
|
||||
|
||||
item_tag_to_add = collapse_namespace_tag(
|
||||
item_tag_to_add = collapse_namespace_tags(
|
||||
item_tag_to_add,
|
||||
"title",
|
||||
prefer="last"
|
||||
@@ -877,7 +877,7 @@ class Add_Tag(Cmdlet):
|
||||
]
|
||||
updated_tag_list.extend(actual_tag_to_add)
|
||||
|
||||
updated_tag_list = collapse_namespace_tag(
|
||||
updated_tag_list = collapse_namespace_tags(
|
||||
updated_tag_list,
|
||||
"title",
|
||||
prefer="last"
|
||||
@@ -977,7 +977,7 @@ class Add_Tag(Cmdlet):
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
item_tag_to_add = collapse_namespace_tag(
|
||||
item_tag_to_add = collapse_namespace_tags(
|
||||
item_tag_to_add,
|
||||
"title",
|
||||
prefer="last"
|
||||
@@ -1016,7 +1016,7 @@ class Add_Tag(Cmdlet):
|
||||
)
|
||||
unresolved_template_count += len(unresolved_templates)
|
||||
|
||||
item_tag_to_add = collapse_namespace_tag(
|
||||
item_tag_to_add = collapse_namespace_tags(
|
||||
item_tag_to_add,
|
||||
"title",
|
||||
prefer="last"
|
||||
@@ -1032,7 +1032,7 @@ class Add_Tag(Cmdlet):
|
||||
]
|
||||
if len(existing_title_tags) > 1:
|
||||
item_tag_to_add.append(existing_title_tags[-1])
|
||||
item_tag_to_add = collapse_namespace_tag(
|
||||
item_tag_to_add = collapse_namespace_tags(
|
||||
item_tag_to_add,
|
||||
"title",
|
||||
prefer="last"
|
||||
|
||||
@@ -649,7 +649,7 @@ def _run_impl(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
item_title=str(items[0].get("title") or provider.name),
|
||||
path=None,
|
||||
subject={
|
||||
"provider": provider.name,
|
||||
"plugin": provider.name,
|
||||
"url": str(query_hint)
|
||||
},
|
||||
quiet=emit_mode,
|
||||
@@ -692,7 +692,7 @@ def _run_impl(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
)
|
||||
payload = {
|
||||
"tag": tags,
|
||||
"provider": provider.name,
|
||||
"plugin": provider.name,
|
||||
"title": item.get("title"),
|
||||
"artist": item.get("artist"),
|
||||
"album": item.get("album"),
|
||||
@@ -702,7 +702,7 @@ def _run_impl(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
"path": path_for_payload,
|
||||
"extra": {
|
||||
"tag": tags,
|
||||
"provider": provider.name,
|
||||
"plugin": provider.name,
|
||||
},
|
||||
}
|
||||
selection_payload.append(payload)
|
||||
@@ -721,7 +721,7 @@ def _run_impl(result: Any, args: Sequence[str], config: Dict[str, Any]) -> int:
|
||||
|
||||
# If the current result already carries a tag list (e.g. a selected metadata
|
||||
# row from get-tag -scrape itunes), APPLY those tags to the file in the store.
|
||||
result_provider = get_field(result, "provider", None)
|
||||
result_provider = get_field(result, "plugin", None)
|
||||
result_tags = get_field(result, "tag", None)
|
||||
|
||||
if result_provider and isinstance(result_tags, list) and result_tags:
|
||||
|
||||
Reference in New Issue
Block a user