From 2ab0fd42e8201254c7c756fccb2f76e414853571 Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Fri, 20 Mar 2026 11:16:50 -0300 Subject: [PATCH] feat(recent-search): use capatabilities to identify wheter upload_time is supported and use upload_time Signed-off-by: Cristian Scheid --- lib/dav/davProperties.ts | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/lib/dav/davProperties.ts b/lib/dav/davProperties.ts index 6d97e40e0..529279fd0 100644 --- a/lib/dav/davProperties.ts +++ b/lib/dav/davProperties.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ import { getCurrentUser } from '@nextcloud/auth' +import { getCapabilities } from '@nextcloud/capabilities' import logger from '../utils/logger' export type DavProperty = { [key: string]: string } @@ -146,6 +147,9 @@ export const getFavoritesReport = function(): string { * ``` */ export const getRecentSearch = function(lastModified: number): string { + const capabilities = getCapabilities() as { dav?: { search_supports_upload_time?: boolean } } + const supportsUploadTime = capabilities.dav?.search_supports_upload_time + return ` @@ -179,12 +183,31 @@ export const getRecentSearch = function(lastModified: number): string { 0 - - - - - ${lastModified} - + ${supportsUploadTime + ? ` + + + + + + ${lastModified} + + + + + + ${lastModified} + + + ` + : ` + + + + + ${lastModified} + + `}