]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fetch quota with files propfind
authorJulius Härtl <jus@bitgrid.net>
Fri, 16 Oct 2020 12:22:47 +0000 (14:22 +0200)
committerJulius Härtl <jus@bitgrid.net>
Tue, 17 Nov 2020 14:33:54 +0000 (15:33 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
core/src/files/client.js
core/src/files/fileinfo.js

index b4bbb5814a5a57aa270150d84740daa8801fe631..4e606f4f5acdbf1ef130e7ce88e96f11fd989582 100644 (file)
@@ -82,6 +82,7 @@ import escapeHTML from 'escape-html'
        Client.PROPERTY_GETCONTENTLENGTH        = '{' + Client.NS_DAV + '}getcontentlength'
        Client.PROPERTY_ISENCRYPTED     = '{' + Client.NS_DAV + '}is-encrypted'
        Client.PROPERTY_SHARE_PERMISSIONS       = '{' + Client.NS_OCS + '}share-permissions'
+       Client.PROPERTY_QUOTA_AVAILABLE_BYTES   = '{' + Client.NS_DAV + '}quota-available-bytes'
 
        Client.PROTOCOL_HTTP    = 'http'
        Client.PROTOCOL_HTTPS   = 'https'
@@ -120,6 +121,7 @@ import escapeHTML from 'escape-html'
                 * File sizes
                 */
                [Client.NS_DAV, 'getcontentlength'],
+               [Client.NS_DAV, 'quota-available-bytes'],
                /**
                 * Preview availability
                 */
@@ -397,6 +399,11 @@ import escapeHTML from 'escape-html'
                                data.mountType = mounTypeProp
                        }
 
+                       const quotaAvailableBytes = props['{' + Client.NS_DAV + '}quota-available-bytes']
+                       if (!_.isUndefined(quotaAvailableBytes)) {
+                               data.quotaAvailableBytes = quotaAvailableBytes
+                       }
+
                        // extend the parsed data using the custom parsers
                        _.each(this._fileInfoParsers, function(parserFunction) {
                                _.extend(data, parserFunction(response, data) || {})
index cfa8702c0a8f46ce2d93ceb1b60396e25849a0f6..19baad5a2d781dae2fd1f1b8036e10ce4cb3aacc 100644 (file)
                 * @type int
                 */
                sharePermissions: null,
+
+               quotaAvailableBytes: -1,
        }
 
        if (!OC.Files) {