fix(dav): add missing search_supports_creation_time and search_supports_upload_time to Capabilities return type

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
Cristian Scheid 2026-03-03 18:31:57 -03:00 committed by nextcloud-command
parent 6bae0a92f0
commit 7991928c2e
10 changed files with 37 additions and 6 deletions

View file

@ -17,12 +17,13 @@ class Capabilities implements ICapability {
}
/**
* @return array{dav: array{chunking: string, bulkupload?: string, absence-supported?: bool, absence-replacement?: bool}}
* @return array{dav: array{chunking: string, search_supports_creation_time: bool, search_supports_upload_time: bool, bulkupload?: string, absence-supported?: bool, absence-replacement?: bool}}
*/
public function getCapabilities() {
$capabilities = [
'dav' => [
'chunking' => '1.0',
'search_supports_creation_time' => true,
'search_supports_upload_time' => true,
]
];

View file

@ -85,6 +85,7 @@ class FileSearchBackend implements ISearchBackend {
new SearchPropertyDefinition('{DAV:}displayname', true, true, true),
new SearchPropertyDefinition('{DAV:}getcontenttype', true, true, true),
new SearchPropertyDefinition('{DAV:}getlastmodified', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME),
new SearchPropertyDefinition('{DAV:}creationdate', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME),
new SearchPropertyDefinition('{http://nextcloud.org/ns}upload_time', true, true, true, SearchPropertyDefinition::DATATYPE_DATETIME),
new SearchPropertyDefinition(FilesPlugin::SIZE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_NONNEGATIVE_INTEGER),
new SearchPropertyDefinition(TagsPlugin::FAVORITE_PROPERTYNAME, true, true, true, SearchPropertyDefinition::DATATYPE_BOOLEAN),
@ -298,6 +299,8 @@ class FileSearchBackend implements ISearchBackend {
return $node->getName();
case '{DAV:}getlastmodified':
return $node->getLastModified();
case '{DAV:}creationdate':
return $node->getNode()->getCreationTime();
case '{http://nextcloud.org/ns}upload_time':
return $node->getNode()->getUploadTime();
case FilesPlugin::SIZE_PROPERTYNAME:
@ -454,6 +457,8 @@ class FileSearchBackend implements ISearchBackend {
return 'mimetype';
case '{DAV:}getlastmodified':
return 'mtime';
case '{DAV:}creationdate':
return 'creation_time';
case '{http://nextcloud.org/ns}upload_time':
return 'upload_time';
case FilesPlugin::SIZE_PROPERTYNAME:

View file

@ -29,12 +29,20 @@
"dav": {
"type": "object",
"required": [
"chunking"
"chunking",
"search_supports_creation_time",
"search_supports_upload_time"
],
"properties": {
"chunking": {
"type": "string"
},
"search_supports_creation_time": {
"type": "boolean"
},
"search_supports_upload_time": {
"type": "boolean"
},
"bulkupload": {
"type": "string"
},

View file

@ -28,6 +28,8 @@ class CapabilitiesTest extends TestCase {
$expected = [
'dav' => [
'chunking' => '1.0',
'search_supports_creation_time' => true,
'search_supports_upload_time' => true,
],
];
$this->assertSame($expected, $capabilities->getCapabilities());
@ -47,6 +49,8 @@ class CapabilitiesTest extends TestCase {
$expected = [
'dav' => [
'chunking' => '1.0',
'search_supports_creation_time' => true,
'search_supports_upload_time' => true,
'bulkupload' => '1.0',
],
];
@ -67,6 +71,8 @@ class CapabilitiesTest extends TestCase {
$expected = [
'dav' => [
'chunking' => '1.0',
'search_supports_creation_time' => true,
'search_supports_upload_time' => true,
'absence-supported' => true,
'absence-replacement' => true,
],

View file

@ -39,6 +39,11 @@
<FavoriteIcon v-once />
</span>
<!-- Recently created icon -->
<span v-else-if="isRecentView && isRecentlyCreated" class="files-list__row-icon-recently-created">
<RecentlyCreatedIcon v-once />
</span>
<OverlayIcon :is="fileOverlay"
v-if="fileOverlay"
class="files-list__row-icon-overlay files-list__row-icon-overlay--file" />
@ -70,6 +75,7 @@ import PlayCircleIcon from 'vue-material-design-icons/PlayCircle.vue'
import CollectivesIcon from './CollectivesIcon.vue'
import FavoriteIcon from './FavoriteIcon.vue'
import RecentlyCreatedIcon from './RecentlyCreatedIcon.vue'
import { isLivePhoto } from '../../services/LivePhotos'
import { useUserConfigStore } from '../../store/userconfig.ts'

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

View file

@ -52,6 +52,9 @@ This file is generated from multiple sources. Included packages:
- @linusborg/vue-simple-portal
- version: 0.1.5
- license: Apache-2.0
- @mdi/js
- version: 7.4.47
- license: Apache-2.0
- @mdi/svg
- version: 7.4.47
- license: Apache-2.0

File diff suppressed because one or more lines are too long

View file

@ -151,7 +151,7 @@ class QuerySearchHelper {
$requestedFields = $this->searchBuilder->extractRequestedFields($searchQuery->getSearchOperation());
$joinExtendedCache = in_array('upload_time', $requestedFields);
$joinExtendedCache = in_array('creation_time', $requestedFields) || in_array('upload_time', $requestedFields);
$query = $builder->selectFileCache('file', $joinExtendedCache);

View file

@ -63,6 +63,7 @@ class SearchBuilder {
'share_with' => 'string',
'share_type' => 'integer',
'owner' => 'string',
'creation_time' => 'integer',
'upload_time' => 'integer',
];
@ -257,6 +258,7 @@ class SearchBuilder {
'share_with' => ['eq'],
'share_type' => ['eq'],
'owner' => ['eq'],
'creation_time' => ['eq', 'gt', 'lt', 'gte', 'lte'],
'upload_time' => ['eq', 'gt', 'lt', 'gte', 'lte'],
];