@xuda.io/drive_module 1.1.542 → 1.1.543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -712,9 +712,8 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
712
712
|
return {
|
|
713
713
|
code: 760,
|
|
714
714
|
data: {
|
|
715
|
-
server_file_name: `https://${process.env.XUDA_HOSTNAME}/${
|
|
716
|
-
req.
|
|
717
|
-
}${req.file_name}`,
|
|
715
|
+
server_file_name: `https://${process.env.XUDA_HOSTNAME}/${req.drive_type === "studio" ? "uploads" : "drive"
|
|
716
|
+
}${req.file_name}`,
|
|
718
717
|
filename: file_obj.originalname,
|
|
719
718
|
},
|
|
720
719
|
};
|
|
@@ -1288,7 +1287,7 @@ exports.extract_drive_file = async function (req, job_id, headers) {
|
|
|
1288
1287
|
|
|
1289
1288
|
try {
|
|
1290
1289
|
await db_module.save_app_couch_doc(app_id_reference, file_doc);
|
|
1291
|
-
} catch (error) {}
|
|
1290
|
+
} catch (error) { }
|
|
1292
1291
|
})
|
|
1293
1292
|
.on("close", () => {
|
|
1294
1293
|
console.log("Extraction complete.");
|
|
@@ -1483,15 +1482,12 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1483
1482
|
break;
|
|
1484
1483
|
}
|
|
1485
1484
|
|
|
1486
|
-
let file_url = `https://${
|
|
1487
|
-
|
|
1488
|
-
}/${drive_type}-drive/${ref}${
|
|
1489
|
-
file_name.substr(0, 1) === "" ? "/" : ""
|
|
1490
|
-
}${file_name}`;
|
|
1491
|
-
if (["workspace"].includes(req.drive_type)) {
|
|
1492
|
-
file_url = `https://${process.env.XUDA_HOSTNAME}/workspace-drive${
|
|
1493
|
-
file_name.substr(0, 1) === "" ? "/" : ""
|
|
1485
|
+
let file_url = `https://${process.env.XUDA_HOSTNAME
|
|
1486
|
+
}/${drive_type}-drive/${ref}${file_name.substr(0, 1) !== "/" ? "/" : ""
|
|
1494
1487
|
}${file_name}`;
|
|
1488
|
+
if (["workspace"].includes(req.drive_type)) {
|
|
1489
|
+
file_url = `https://${process.env.XUDA_HOSTNAME}/workspace-drive${file_name.substr(0, 1) !== "/" ? "/" : ""
|
|
1490
|
+
}${file_name}`;
|
|
1495
1491
|
}
|
|
1496
1492
|
|
|
1497
1493
|
await fs_module.unlink(tempPath);
|
|
@@ -2047,7 +2043,7 @@ const get_file_info = async function (file_path) {
|
|
|
2047
2043
|
const sizeOf = require("image-size");
|
|
2048
2044
|
const dimensions = sizeOf(file_path);
|
|
2049
2045
|
doc.dimensions = `${dimensions.width}x${dimensions.height}`;
|
|
2050
|
-
} catch (error) {}
|
|
2046
|
+
} catch (error) { }
|
|
2051
2047
|
return doc;
|
|
2052
2048
|
};
|
|
2053
2049
|
|
|
@@ -2106,4 +2102,4 @@ const get_folder_docs = async function (dir, drive_type, app_id) {
|
|
|
2106
2102
|
return docs;
|
|
2107
2103
|
};
|
|
2108
2104
|
|
|
2109
|
-
setTimeout(function () {}, 2000);
|
|
2105
|
+
setTimeout(function () { }, 2000);
|