@xuda.io/drive_module 1.1.773 → 1.1.775

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.
Files changed (2) hide show
  1. package/index.js +22 -18
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2581,24 +2581,28 @@ const get_drive_doc = async function (drive_type, app_id, uid, file_path) {
2581
2581
  break;
2582
2582
  }
2583
2583
 
2584
- if (doc_ret.code < 0 && drive_type === "studio") {
2585
- const ext = path.extname(file_name).toLowerCase();
2586
- doc = {
2587
- _id: file_name,
2588
- docType: `${drive_type}_drive`,
2589
- stat: 3,
2590
- server_file_name: file_name,
2591
- originalname: file_name,
2592
- uid,
2593
- date_created: Date.now(),
2594
- ip: headers["cf-connecting-ip"],
2595
- country: headers["cf-ipcountry"],
2596
- file_ext: ext,
2597
- is_archive: _conf.archive_drive_ext.includes(ext) ? true : false,
2598
- drive_type,
2599
- };
2584
+ if (doc_ret.code < 0) {
2585
+ if (drive_type === "studio") {
2586
+ const ext = path.extname(file_name).toLowerCase();
2587
+ doc = {
2588
+ _id: file_name,
2589
+ docType: `${drive_type}_drive`,
2590
+ stat: 3,
2591
+ server_file_name: file_name,
2592
+ originalname: file_name,
2593
+ uid,
2594
+ date_created: Date.now(),
2595
+ ip: headers["cf-connecting-ip"],
2596
+ country: headers["cf-ipcountry"],
2597
+ file_ext: ext,
2598
+ is_archive: _conf.archive_drive_ext.includes(ext) ? true : false,
2599
+ drive_type,
2600
+ };
2600
2601
 
2601
- doc.app_id = await _common.get_project_app_id(app_id);
2602
- doc.app_id_reference = await _common.get_project_app_id(app_id, true);
2602
+ doc.app_id = await _common.get_project_app_id(app_id);
2603
+ doc.app_id_reference = await _common.get_project_app_id(app_id, true);
2604
+ } else {
2605
+ throw new Error("file doc not found");
2606
+ }
2603
2607
  }
2604
2608
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.773",
3
+ "version": "1.1.775",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {