This commit is contained in:
2026-01-19 21:25:44 -08:00
parent 37e2ff6651
commit fcab85455d
13 changed files with 820 additions and 393 deletions

View File

@@ -192,10 +192,21 @@ class Get_Metadata(Cmdlet):
# Use storage backend to get metadata
try:
from Store import Store
# Instantiate only the required backend when possible to avoid initializing all configured backends
try:
from Store.registry import get_backend_instance
backend = get_backend_instance(config, storage_source, suppress_debug=True)
except Exception:
backend = None
storage = Store(config)
backend = storage[storage_source]
if backend is None:
try:
from Store import Store
storage = Store(config)
backend = storage[storage_source]
except Exception:
log(f"Storage backend '{storage_source}' not found", file=sys.stderr)
return 1
# Get metadata from backend
metadata = backend.get_metadata(file_hash)
@@ -290,6 +301,13 @@ class Get_Metadata(Cmdlet):
list(args))
self._add_table_body_row(table, row)
ctx.set_last_result_table_overlay(table, [row], row)
try:
from SYS.rich_display import render_item_details_panel
render_item_details_panel(row)
table._rendered_by_cmdlet = True
except Exception:
pass
ctx.emit(row)
return 0