- const name = getTagValue(element, 'D:displayname', '');
- const size = parseInt(getTagValue(element, 'D:getcontentlength', '0'), 10);
- const url = getTagValue(element, 'D:href', '');
- const nameSuffix = `/${name || ''}`;
- const directory = url
+ const name = getTagValue(element, 'D:displayname', '', true); // skip decoding as value should be already decoded
+ const size = parseInt(getTagValue(element, 'D:getcontentlength', '0', true), 10);
+ const url = getTagValue(element, 'D:href', '', true);
+ const collectionUuidMatch = collectionUrlPrefix.exec(url);
+ const collectionUuid = collectionUuidMatch ? collectionUuidMatch.pop() : '';
+ const pathArray = url.split(`/`);
+ if (!pathArray.pop()) {
+ pathArray.pop();
+ }
+ const directory = pathArray.join('/')