From e4dcec8d5fabe8d2de8ff74b4ede81c89271ef31 Mon Sep 17 00:00:00 2001 From: grnd-alt Date: Wed, 18 Feb 2026 10:30:39 +0100 Subject: [PATCH] fix: show file size on remote shares Signed-off-by: grnd-alt --- .../lib/Controller/RemoteController.php | 1 + .../files_sharing/lib/External/ExternalShare.php | 1 + apps/files_sharing/lib/ResponseDefinitions.php | 1 + apps/files_sharing/openapi.json | 16 +++++++++++++++- openapi.json | 16 +++++++++++++++- 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/Controller/RemoteController.php b/apps/files_sharing/lib/Controller/RemoteController.php index 590ebdd5d944b..d95ea251d894f 100644 --- a/apps/files_sharing/lib/Controller/RemoteController.php +++ b/apps/files_sharing/lib/Controller/RemoteController.php @@ -124,6 +124,7 @@ private function extendShareInfo(ExternalShare $share): array { $shareData['permissions'] = $mountPointNode->getPermissions(); $shareData['type'] = $mountPointNode->getType(); $shareData['file_id'] = $mountPointNode->getId(); + $shareData['item_size'] = $mountPointNode->getSize(); return $shareData; } diff --git a/apps/files_sharing/lib/External/ExternalShare.php b/apps/files_sharing/lib/External/ExternalShare.php index 79a4ab9cf0056..72e1e4d698255 100644 --- a/apps/files_sharing/lib/External/ExternalShare.php +++ b/apps/files_sharing/lib/External/ExternalShare.php @@ -112,6 +112,7 @@ public function jsonSerialize(): array { 'permissions' => null, 'mtime' => null, 'type' => null, + 'item_size' => null, ]; } diff --git a/apps/files_sharing/lib/ResponseDefinitions.php b/apps/files_sharing/lib/ResponseDefinitions.php index 58277577eabdd..1585645241759 100644 --- a/apps/files_sharing/lib/ResponseDefinitions.php +++ b/apps/files_sharing/lib/ResponseDefinitions.php @@ -97,6 +97,7 @@ * share_type: int, * type: string|null, * user: string, + * item_size: int|float|null, * } * * @psalm-type Files_SharingSharee = array{ diff --git a/apps/files_sharing/openapi.json b/apps/files_sharing/openapi.json index 257250434f134..8a9a919f67672 100644 --- a/apps/files_sharing/openapi.json +++ b/apps/files_sharing/openapi.json @@ -407,7 +407,8 @@ "share_token", "share_type", "type", - "user" + "user", + "item_size" ], "properties": { "accepted": { @@ -468,6 +469,19 @@ }, "user": { "type": "string" + }, + "item_size": { + "nullable": true, + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + } + ] } } }, diff --git a/openapi.json b/openapi.json index ab25747a0f58d..ca5b2b566f709 100644 --- a/openapi.json +++ b/openapi.json @@ -2526,7 +2526,8 @@ "share_token", "share_type", "type", - "user" + "user", + "item_size" ], "properties": { "accepted": { @@ -2587,6 +2588,19 @@ }, "user": { "type": "string" + }, + "item_size": { + "nullable": true, + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "number", + "format": "double" + } + ] } } },