Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix: Remove duplicate propfind call
This also was an XHR call which is not going through the end to end encryption proxy

Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Jan 15, 2025
commit b1bc79394067ca3914ea3970e5d242f2e2bf405c
30 changes: 0 additions & 30 deletions apps/files/src/services/FileInfo.js

This file was deleted.

35 changes: 35 additions & 0 deletions apps/files/src/services/FileInfo.ts
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
}
4 changes: 2 additions & 2 deletions apps/files/src/views/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ export default {
this.loading = true

try {
this.fileInfo = await FileInfo(this.davPath)
this.node = await fetchNode({ path: this.file })
this.fileInfo = FileInfo(this.node)
// adding this as fallback because other apps expect it
this.fileInfo.dir = this.file.split('/').slice(0, -1).join('/')
this.node = await fetchNode({ path: (this.fileInfo.path + '/' + this.fileInfo.name).replace('//', '/') })

// DEPRECATED legacy views
// TODO: remove
Expand Down