Fix folder metadata appearing as folder in downloaded drive zip

pull/1/head
ClemDee 5 years ago
parent 3bd09d986e
commit 38b414bbe1

@ -163,12 +163,12 @@ define([
var existingNames = []; var existingNames = [];
Object.keys(root).forEach(function (k) { Object.keys(root).forEach(function (k) {
var el = root[k]; var el = root[k];
if (typeof el === "object") { if (typeof el === "object" && el.metadata !== true) { // if folder
var fName = getUnique(sanitize(k), '', existingNames); var fName = getUnique(sanitize(k), '', existingNames);
existingNames.push(fName.toLowerCase()); existingNames.push(fName.toLowerCase());
return void makeFolder(ctx, el, zip.folder(fName), fd); return void makeFolder(ctx, el, zip.folder(fName), fd);
} }
if (ctx.data.sharedFolders[el]) { if (ctx.data.sharedFolders[el]) { // if shared folder
var sfData = ctx.sf[el].metadata; var sfData = ctx.sf[el].metadata;
var sfName = getUnique(sanitize(sfData.title || 'Folder'), '', existingNames); var sfName = getUnique(sanitize(sfData.title || 'Folder'), '', existingNames);
existingNames.push(sfName.toLowerCase()); existingNames.push(sfName.toLowerCase());

Loading…
Cancel
Save