-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50109 from nextcloud/artonge/fix/remove_duplicate…
…_propfind_call fix: Remove duplicate propfind call
- Loading branch information
Showing
5 changed files
with
40 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
/* eslint-disable jsdoc/require-jsdoc */ | ||
|
||
import type { Node } from '@nextcloud/files' | ||
|
||
export default function(node: Node) { | ||
const fileInfo = new OC.Files.FileInfo({ | ||
id: node.fileid, | ||
path: node.dirname, | ||
name: node.basename, | ||
mtime: node.mtime?.getTime(), | ||
etag: node.attributes.etag, | ||
size: node.size, | ||
hasPreview: node.attributes.hasPreview, | ||
isEncrypted: node.attributes.isEncrypted === 1, | ||
isFavourited: node.attributes.favorite === 1, | ||
mimetype: node.mime, | ||
permissions: node.permissions, | ||
mountType: node.attributes['mount-type'], | ||
sharePermissions: node.attributes['share-permissions'], | ||
shareAttributes: JSON.parse(node.attributes['share-attributes']), | ||
type: node.type === 'file' ? 'file' : 'dir', | ||
}) | ||
|
||
// TODO remove when no more legacy backbone is used | ||
fileInfo.get = (key) => fileInfo[key] | ||
fileInfo.isDirectory = () => fileInfo.mimetype === 'httpd/unix-directory' | ||
fileInfo.canEdit = () => Boolean(fileInfo.permissions & OC.PERMISSION_UPDATE) | ||
|
||
return fileInfo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.