Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions lib/dav/davProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export function getFavoritesReport(): string {
}

/**
* Get the SEARCH body to search for recently modified files
* Get the SEARCH body to search for recently modified/uploaded files
*
* @param lastModified Oldest timestamp to include (Unix timestamp)
* @param timestamp Oldest timestamp to include (Unix timestamp)
* @example
* ```ts
* // SEARCH for recent files need a different DAV endpoint
Expand All @@ -139,7 +139,7 @@ export function getFavoritesReport(): string {
* }) as ResponseDataDetailed<FileStat[]>
* ```
*/
export function getRecentSearch(lastModified: number): string {
export function getRecentSearch(timestamp: number): string {
return `<?xml version="1.0" encoding="UTF-8"?>
<d:searchrequest ${getDavNameSpaces()}
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
Expand Down Expand Up @@ -173,12 +173,20 @@ export function getRecentSearch(lastModified: number): string {
<d:literal>0</d:literal>
</d:eq>
</d:or>
<d:gt>
<d:prop>
<d:getlastmodified/>
</d:prop>
<d:literal>${lastModified}</d:literal>
</d:gt>
<d:or>
<d:gt>
<d:prop>
<d:getlastmodified/>
</d:prop>
<d:literal>${timestamp}</d:literal>
</d:gt>
<d:gt>
<d:prop>
<nc:upload_time/>
</d:prop>
<d:literal>${timestamp}</d:literal>
</d:gt>
</d:or>
</d:and>
</d:where>
<d:orderby>
Expand Down