@xuda.io/drive_module 1.1.544 → 1.1.545
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 +11 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1427,15 +1427,22 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1427
1427
|
file_name = file_obj.originalname;
|
|
1428
1428
|
}
|
|
1429
1429
|
|
|
1430
|
-
// target_file = path.join(
|
|
1431
|
-
// req.path !== "/" ? req.path : target_dir,
|
|
1432
|
-
// file_name
|
|
1433
|
-
// );
|
|
1434
1430
|
doc.server_file_name = file_name;
|
|
1435
1431
|
|
|
1436
1432
|
doc.app_id = app_id;
|
|
1437
1433
|
doc.app_id_reference = ref;
|
|
1438
1434
|
|
|
1435
|
+
/// check existing file
|
|
1436
|
+
if (!override) {
|
|
1437
|
+
const workspace_drive_res = await db_module.find_couch_query(
|
|
1438
|
+
"xuda_drive",
|
|
1439
|
+
{
|
|
1440
|
+
selector: { docType: "user_drive", ocr_stat: 1, stat: 3 },
|
|
1441
|
+
limit: 1,
|
|
1442
|
+
}
|
|
1443
|
+
);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1439
1446
|
doc.bucket = {
|
|
1440
1447
|
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(
|
|
1441
1448
|
tempPath,
|