mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
python: sorting by date
This commit is contained in:
@ -97,8 +97,10 @@ def getStoredFiles(req):
|
||||
directory = getRootFolder(req)
|
||||
|
||||
files = os.listdir(directory)
|
||||
files.sort(key=lambda x: os.path.getmtime(os.path.join(directory, x)), reverse=True)
|
||||
|
||||
fileInfos = []
|
||||
|
||||
for f in files:
|
||||
if os.path.isfile(os.path.join(directory, f)):
|
||||
fileInfos.append({ 'type': fileUtils.getFileType(f), 'title': f, 'url': getFileUri(f, req) })
|
||||
|
||||
Reference in New Issue
Block a user