f
This commit is contained in:
@@ -149,6 +149,7 @@ def _as_dict(item: Any) -> Optional[Dict[str, Any]]:
|
||||
Returns:
|
||||
Dictionary representation or None if conversion fails
|
||||
"""
|
||||
if isinstance(item, dict):
|
||||
return item
|
||||
try:
|
||||
if hasattr(item, "__dict__"):
|
||||
@@ -171,6 +172,7 @@ def extract_store_value(item: Any) -> str:
|
||||
Returns:
|
||||
Store name as string (e.g., "hydrus", "local", "") if not found
|
||||
"""
|
||||
data = _as_dict(item) or {}
|
||||
store = _get_first_dict_value(
|
||||
data,
|
||||
["store",
|
||||
@@ -1149,17 +1151,17 @@ class Table:
|
||||
if (store_extracted and "store" not in visible_data
|
||||
and "table" not in visible_data and "source" not in visible_data):
|
||||
visible_data["store"] = store_extracted
|
||||
except Exception:
|
||||
from SYS.logger import logger
|
||||
logger.exception("Failed to extract store value for item: %r", data)
|
||||
except Exception as e:
|
||||
from SYS.logger import log
|
||||
log(f"Failed to extract store value for item: {data!r}. Error: {e}")
|
||||
|
||||
try:
|
||||
ext_extracted = extract_ext_value(data)
|
||||
# Always ensure `ext` exists so priority_groups keeps a stable column.
|
||||
visible_data["ext"] = str(ext_extracted or "")
|
||||
except Exception:
|
||||
from SYS.logger import logger
|
||||
logger.exception("Failed to extract ext value for item: %r", data)
|
||||
except Exception as e:
|
||||
from SYS.logger import log
|
||||
log(f"Failed to extract ext value for item: {data!r}. Error: {e}")
|
||||
visible_data.setdefault("ext", "")
|
||||
|
||||
try:
|
||||
@@ -1167,9 +1169,9 @@ class Table:
|
||||
if (size_extracted is not None and "size_bytes" not in visible_data
|
||||
and "size" not in visible_data):
|
||||
visible_data["size_bytes"] = size_extracted
|
||||
except Exception:
|
||||
from SYS.logger import logger
|
||||
logger.exception("Failed to extract size bytes for item: %r", data)
|
||||
except Exception as e:
|
||||
from SYS.logger import log
|
||||
log(f"Failed to extract size bytes for item: {data!r}. Error: {e}")
|
||||
|
||||
# Handle extension separation for local files
|
||||
store_val = str(
|
||||
|
||||
Reference in New Issue
Block a user