Fix anonymous full drive download

- Related to #1782
- Anonymous full drive download is now working
    - One known false positive in the test that should not be too bad
      (the behaviour stays the same)
This commit is contained in:
Fabrice Mouhartem 2025-02-13 16:39:13 +01:00
parent 4173174012
commit f8442e9b98
No known key found for this signature in database
GPG Key ID: 90579C24FD123C93

View File

@ -353,6 +353,21 @@ define([
var filesData = data.sharedFolderId && ctx.sf[data.sharedFolderId] ? ctx.sf[data.sharedFolderId].filesData : ctx.data.filesData;
var links = ctx.sf[data.sharedFolderId] && ctx.sf[data.sharedFolderId].static ? ctx.data.static && ctx.sf[data.sharedFolderId].static : ctx.data.static;
if (data.uo.curvePublic == undefined && Object.keys(ctx.data.root).length === 0) {
// Anonymous Drive
// In anonymous drive, there are no root folder in the data
// We are going to emulate it
// One false positive: empty team drive but the result is
// functionally equivalent
console.log("Anonymous drive"); // XXX: remove after testing phase
ctx.data.root = {};
let index = 0;
Object.keys(ctx.data.filesData).forEach(file => {
ctx.data.root[index] = file;
index += 1;
});
}
progress('reading', -1); // Msg.settings_export_reading
nThen(function (waitFor) {
ctx.waitFor = waitFor;