mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
feat: change load from cloud format and order
This commit is contained in:
parent
3694d77b87
commit
44e98d853f
4 changed files with 2362 additions and 525 deletions
|
|
@ -73,7 +73,13 @@ window.Cloud = (function () {
|
|||
|
||||
async list() {
|
||||
const resp = await this.call("filesListFolder", {path: ""});
|
||||
return resp.result.entries.map(e => ({name: e.name, path: e.path_lower}));
|
||||
const filesData = resp.result.entries.map(({name, client_modified, size, path_lower}) => ({
|
||||
name: name,
|
||||
updated: client_modified,
|
||||
size,
|
||||
path: path_lower
|
||||
}));
|
||||
return filesData.filter(({size}) => size).reverse();
|
||||
},
|
||||
|
||||
auth() {
|
||||
|
|
@ -117,7 +123,13 @@ window.Cloud = (function () {
|
|||
if (sharedLinks.result.links.length) return resp.result.links[0].url;
|
||||
|
||||
// create new shared link
|
||||
const settings = {require_password: false, audience: "public", access: "viewer", requested_visibility: "public", allow_download: true};
|
||||
const settings = {
|
||||
require_password: false,
|
||||
audience: "public",
|
||||
access: "viewer",
|
||||
requested_visibility: "public",
|
||||
allow_download: true
|
||||
};
|
||||
const resp = await this.call("sharingCreateSharedLinkWithSettings", {path, settings});
|
||||
DEBUG && console.log("Dropbox link object:", resp.result);
|
||||
return resp.result.url;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue