@@ -114,7 +114,6 @@ import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
114114import NcIconSvgWrapper from ' @nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
115115import NcUserBubble from ' @nextcloud/vue/dist/Components/NcUserBubble.js'
116116
117- import FileInfo from ' ../services/FileInfo.js'
118117import LegacyView from ' ../components/LegacyView.vue'
119118import SidebarTab from ' ../components/SidebarTab.vue'
120119import SystemTags from ' ../../../systemtags/src/components/SystemTags.vue'
@@ -487,10 +486,31 @@ export default {
487486 this .loading = true
488487
489488 try {
490- this .fileInfo = await FileInfo (this .davPath )
491- // adding this as fallback because other apps expect it
492- this .fileInfo .dir = this .file .split (' /' ).slice (0 , - 1 ).join (' /' )
493- this .node = await fetchNode ({ path: (this .fileInfo .path + ' /' + this .fileInfo .name ).replace (' //' , ' /' ) })
489+ this .node = await fetchNode ({ path: this .file })
490+ this .fileInfo = {
491+ id: this .node .fileid ,
492+ path: this .node .dirname ,
493+ name: this .node .basename ,
494+ mtime: this .node .mtime .getTime (),
495+ etag: this .node .attributes .etag ,
496+ size: this .node .size ,
497+ hasPreview: this .node .attributes .hasPreview ,
498+ isEncrypted: this .node .attributes .isEncrypted === 1 ,
499+ isFavourited: this .node .attributes .favorite === 1 ,
500+ mimetype: this .node .mime ,
501+ permissions: this .node .permissions ,
502+ mountType: this .node .attributes [' mount-type' ],
503+ sharePermissions: this .node .attributes [' share-permissions' ],
504+ shareAttributes: this .node .attributes [' share-attributes' ],
505+ type: this .node .type ,
506+ // adding this as fallback because other apps expect it
507+ dir: this .file .split (' /' ).slice (0 , - 1 ).join (' /' ),
508+ }
509+
510+ // TODO remove when no more legacy backbone is used
511+ this .fileInfo .get = (key ) => this .fileInfo [key]
512+ this .fileInfo .isDirectory = () => this .fileInfo .mimetype === ' httpd/unix-directory'
513+ this .fileInfo .canEdit = () => Boolean (this .fileInfo .permissions & OC .PERMISSION_UPDATE )
494514
495515 // DEPRECATED legacy views
496516 // TODO: remove
0 commit comments