From b035288f655207170c550b843c4c4d72018a52a4 Mon Sep 17 00:00:00 2001 From: Pavel Stratil Date: Tue, 16 Jan 2024 08:30:43 +0000 Subject: [PATCH] preprod1 --- glued/Controllers/ServiceController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glued/Controllers/ServiceController.php b/glued/Controllers/ServiceController.php index 2e5eadd..7908ae1 100644 --- a/glued/Controllers/ServiceController.php +++ b/glued/Controllers/ServiceController.php @@ -472,12 +472,18 @@ public function objects_r1(Request $request, Response $response, array $args = [ o.name as name, f.c_ext as ext, o.ts_created as created, + -- om.data as meta, + CASE + WHEN om.data IS NULL OR JSON_LENGTH(om.data) = 0 THEN NULL + ELSE om.data + END AS meta, fwd.refs, back.backrefs FROM `t_stor_objects` o LEFT JOIN t_stor_files f ON f.c_hash = o.hash LEFT JOIN v_stor_refs_fwd fwd ON fwd.object = o.object LEFT JOIN v_stor_refs_back back ON back.object = o.object + LEFT JOIN t_stor_objects_meta om ON om.uuid = o.object WHERE bucket = uuid_to_bin(? ,1) {$wm} "; @@ -487,7 +493,7 @@ public function objects_r1(Request $request, Response $response, array $args = [ foreach ($r as &$rr) { if (isset($rr['refs'])) { $rr['refs'] = json_decode($rr['refs']); } if (isset($rr['backrefs'])) { $rr['backrefs'] = json_decode($rr['backrefs']); } - if (isset($rr['backrefs'])) { $rr['backrefs'] = json_decode($rr['backrefs']); } + if (isset($rr['meta'])) { $rr['meta'] = json_decode($rr['meta']); } } if ($wm !== '') { $r = $r[0]; } if ($link) { $r['link'] = $link; }