From a1d0682ef849a452c0be4d107104e476007a6aa1 Mon Sep 17 00:00:00 2001 From: Vincent Petry <pvince81@owncloud.com> Date: Wed, 18 Nov 2015 15:18:00 +0100 Subject: [PATCH] Use oc:fileid property instead of oc:id --- core/js/files/client.js | 20 +++----------------- core/js/tests/specs/files/clientSpec.js | 4 ++-- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/core/js/files/client.js b/core/js/files/client.js index 07a7132d4b..82cf3ff512 100644 --- a/core/js/files/client.js +++ b/core/js/files/client.js @@ -79,9 +79,9 @@ */ [Client.NS_DAV, 'resourcetype'], /** - * Compound file id, contains fileid + server instance id + * File id */ - [Client.NS_OWNCLOUD, 'id'], + [Client.NS_OWNCLOUD, 'fileid'], /** * Letter-coded permissions */ @@ -210,20 +210,6 @@ return headers; }, - /** - * Parses the compound file id - * - * @param {string} compoundFileId compound file id as returned by the server - * - * @return {int} local file id, stripped of the instance id - */ - _parseFileId: function(compoundFileId) { - if (!compoundFileId || compoundFileId.length < 8) { - return null; - } - return parseInt(compoundFileId.substr(0, 8), 10); - }, - /** * Parses the etag response which is in double quotes. * @@ -264,7 +250,7 @@ var props = response.propStat[0].properties; var data = { - id: this._parseFileId(props['{' + Client.NS_OWNCLOUD + '}id']), + id: props['{' + Client.NS_OWNCLOUD + '}fileid'], path: OC.dirname(path) || '/', name: OC.basename(path), mtime: new Date(props['{' + Client.NS_DAV + '}getlastmodified']) diff --git a/core/js/tests/specs/files/clientSpec.js b/core/js/tests/specs/files/clientSpec.js index 7d039b5143..3a3181d842 100644 --- a/core/js/tests/specs/files/clientSpec.js +++ b/core/js/tests/specs/files/clientSpec.js @@ -213,7 +213,7 @@ describe('OC.Files.Client tests', function() { expect(props).toContain('{DAV:}getcontenttype'); expect(props).toContain('{DAV:}getetag'); expect(props).toContain('{DAV:}resourcetype'); - expect(props).toContain('{http://owncloud.org/ns}id'); + expect(props).toContain('{http://owncloud.org/ns}fileid'); expect(props).toContain('{http://owncloud.org/ns}size'); expect(props).toContain('{http://owncloud.org/ns}permissions'); }); @@ -350,7 +350,7 @@ describe('OC.Files.Client tests', function() { expect(props).toContain('{DAV:}getcontenttype'); expect(props).toContain('{DAV:}getetag'); expect(props).toContain('{DAV:}resourcetype'); - expect(props).toContain('{http://owncloud.org/ns}id'); + expect(props).toContain('{http://owncloud.org/ns}fileid'); expect(props).toContain('{http://owncloud.org/ns}size'); expect(props).toContain('{http://owncloud.org/ns}permissions'); }); -- GitLab