f
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user