From 4835d6f5f36653346cfdb735f721111814c1157e Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Fri, 27 Feb 2026 16:25:37 -0300 Subject: [PATCH] refactor(recent-search): use d:creationdate instead of c:creation_time and crtime instead of attributes.upload_time Signed-off-by: Cristian Scheid --- apps/dav/lib/Files/FileSearchBackend.php | 6 +++--- .../src/components/FileEntry/FileEntryPreview.vue | 12 ++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/apps/dav/lib/Files/FileSearchBackend.php b/apps/dav/lib/Files/FileSearchBackend.php index 8561627ffd9..45888f1eac1 100644 --- a/apps/dav/lib/Files/FileSearchBackend.php +++ b/apps/dav/lib/Files/FileSearchBackend.php @@ -86,7 +86,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('{http://nextcloud.org/ns}creation_time', 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), @@ -300,7 +300,7 @@ class FileSearchBackend implements ISearchBackend { return $node->getName(); case '{DAV:}getlastmodified': return $node->getLastModified(); - case '{http://nextcloud.org/ns}creation_time': + case '{DAV:}creationdate': return $node->getNode()->getCreationTime(); case '{http://nextcloud.org/ns}upload_time': return $node->getNode()->getUploadTime(); @@ -464,7 +464,7 @@ class FileSearchBackend implements ISearchBackend { return 'mimetype'; case '{DAV:}getlastmodified': return 'mtime'; - case '{http://nextcloud.org/ns}creation_time': + case '{DAV:}creationdate': return 'creation_time'; case '{http://nextcloud.org/ns}upload_time': return 'upload_time'; diff --git a/apps/files/src/components/FileEntry/FileEntryPreview.vue b/apps/files/src/components/FileEntry/FileEntryPreview.vue index 7b6b4e954c3..f399966507e 100644 --- a/apps/files/src/components/FileEntry/FileEntryPreview.vue +++ b/apps/files/src/components/FileEntry/FileEntryPreview.vue @@ -146,22 +146,14 @@ export default defineComponent({ }, isRecentlyCreated(): boolean { - if (this.source.attributes.upload_time) { - return false - } - - const creationDate = this.source.attributes.creationdate - ? new Date(this.source.attributes.creationdate) - : null - - if (!creationDate) { + if (!this.source.crtime) { return false } const oneDayAgo = new Date() oneDayAgo.setDate(oneDayAgo.getDate() - 1) - return creationDate > oneDayAgo + return this.source.crtime > oneDayAgo }, isRecentView(): boolean {