mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
feat(recent-search): pass recent_limit config value to getRecentSearch function
feat(recent-search): pass recent_limit config value to getRecentSearch function Signed-off-by: Cristian Scheid <cristianscheid@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
parent
32ce6c343a
commit
97237e85d7
3 changed files with 6 additions and 4 deletions
|
|
@ -8,12 +8,14 @@ import type { ResponseDataDetailed, SearchResult } from 'webdav'
|
|||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { Folder, Permission } from '@nextcloud/files'
|
||||
import { getRecentSearch, getRemoteURL, getRootPath, resultToNode } from '@nextcloud/files/dav'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import logger from '../logger.ts'
|
||||
import { getPinia } from '../store/index.ts'
|
||||
import { useUserConfigStore } from '../store/userconfig.ts'
|
||||
import { client } from './WebdavClient.ts'
|
||||
|
||||
const lastTwoWeeksTimestamp = Math.round((Date.now() / 1000) - (60 * 60 * 24 * 14))
|
||||
const recentLimit = loadState<number>('files', 'recent_limit', 100)
|
||||
|
||||
/**
|
||||
* Get recently changed nodes
|
||||
|
|
@ -41,7 +43,7 @@ export async function getContents(path = '/', options: { signal: AbortSignal }):
|
|||
const contentsResponse = await client.search('/', {
|
||||
signal: options.signal,
|
||||
details: true,
|
||||
data: getRecentSearch(lastTwoWeeksTimestamp),
|
||||
data: getRecentSearch(lastTwoWeeksTimestamp, recentLimit),
|
||||
}) as ResponseDataDetailed<SearchResult>
|
||||
|
||||
const contents = contentsResponse.data.results
|
||||
|
|
|
|||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue