ssd
This commit is contained in:
@@ -61,15 +61,22 @@ class Provider:
|
||||
|
||||
def serialize_row(self, row: ResultModel) -> Dict[str, Any]:
|
||||
r = ensure_result_model(row)
|
||||
return {
|
||||
metadata = r.metadata or {}
|
||||
out: Dict[str, Any] = {
|
||||
"title": r.title,
|
||||
"path": r.path,
|
||||
"ext": r.ext,
|
||||
"size_bytes": r.size_bytes,
|
||||
"metadata": r.metadata or {},
|
||||
"metadata": metadata,
|
||||
"source": r.source or self.name,
|
||||
"_selection_args": self.selection_args(r),
|
||||
}
|
||||
selection_action = metadata.get("_selection_action") or metadata.get("selection_action")
|
||||
if selection_action:
|
||||
out["_selection_action"] = [
|
||||
str(x) for x in selection_action if x is not None
|
||||
]
|
||||
return out
|
||||
|
||||
def serialize_rows(self, rows: Iterable[ResultModel]) -> List[Dict[str, Any]]:
|
||||
return [self.serialize_row(r) for r in rows]
|
||||
|
||||
Reference in New Issue
Block a user