Skip to content

Commit e4dcec8

Browse files
committed
fix: show file size on remote shares
Signed-off-by: grnd-alt <git@belakkaf.net>
1 parent a6d1fa1 commit e4dcec8

5 files changed

Lines changed: 33 additions & 2 deletions

File tree

apps/files_sharing/lib/Controller/RemoteController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ private function extendShareInfo(ExternalShare $share): array {
124124
$shareData['permissions'] = $mountPointNode->getPermissions();
125125
$shareData['type'] = $mountPointNode->getType();
126126
$shareData['file_id'] = $mountPointNode->getId();
127+
$shareData['item_size'] = $mountPointNode->getSize();
127128

128129
return $shareData;
129130
}

apps/files_sharing/lib/External/ExternalShare.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public function jsonSerialize(): array {
112112
'permissions' => null,
113113
'mtime' => null,
114114
'type' => null,
115+
'item_size' => null,
115116
];
116117
}
117118

apps/files_sharing/lib/ResponseDefinitions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
* share_type: int,
9898
* type: string|null,
9999
* user: string,
100+
* item_size: int|float|null,
100101
* }
101102
*
102103
* @psalm-type Files_SharingSharee = array{

apps/files_sharing/openapi.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@
407407
"share_token",
408408
"share_type",
409409
"type",
410-
"user"
410+
"user",
411+
"item_size"
411412
],
412413
"properties": {
413414
"accepted": {
@@ -468,6 +469,19 @@
468469
},
469470
"user": {
470471
"type": "string"
472+
},
473+
"item_size": {
474+
"nullable": true,
475+
"anyOf": [
476+
{
477+
"type": "integer",
478+
"format": "int64"
479+
},
480+
{
481+
"type": "number",
482+
"format": "double"
483+
}
484+
]
471485
}
472486
}
473487
},

openapi.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,8 @@
25262526
"share_token",
25272527
"share_type",
25282528
"type",
2529-
"user"
2529+
"user",
2530+
"item_size"
25302531
],
25312532
"properties": {
25322533
"accepted": {
@@ -2587,6 +2588,19 @@
25872588
},
25882589
"user": {
25892590
"type": "string"
2591+
},
2592+
"item_size": {
2593+
"nullable": true,
2594+
"anyOf": [
2595+
{
2596+
"type": "integer",
2597+
"format": "int64"
2598+
},
2599+
{
2600+
"type": "number",
2601+
"format": "double"
2602+
}
2603+
]
25902604
}
25912605
}
25922606
},

0 commit comments

Comments
 (0)