@xuda.io/drive_module 1.1.508 → 1.1.510

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 +5 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -148,6 +148,7 @@ exports.get_drive_files = async function (req) {
148
148
  selector: {
149
149
  docType: "user_drive",
150
150
  stat: 3,
151
+ uid,
151
152
  type,
152
153
  file_path: req.path,
153
154
  },
@@ -197,7 +198,8 @@ exports.get_drive_files = async function (req) {
197
198
  const sizeInBytes = await get_folder_size(
198
199
  req.path,
199
200
  drive_type,
200
- null
201
+ null,
202
+ uid
201
203
  );
202
204
  files.sizeInBytes += sizeInBytes;
203
205
  files.children.push({
@@ -1887,7 +1889,7 @@ exports.get_drive_size = async function (req) {
1887
1889
  break;
1888
1890
  }
1889
1891
 
1890
- size = await get_folder_size(directoryPath, drive_type, app_id_master);
1892
+ size = await get_folder_size(directoryPath, drive_type, app_id_master, uid);
1891
1893
 
1892
1894
  return { code: 200, data: size };
1893
1895
  } catch (err) {
@@ -2020,14 +2022,11 @@ const get_folder_size = async function (dir, drive_type, app_id, uid) {
2020
2022
 
2021
2023
  if (drive_type === "user") {
2022
2024
  opt.selector.uid = uid;
2025
+ ret = await db_module.find_couch_query("xuda_drive", opt);
2023
2026
  } else {
2024
2027
  ret = await db_module.find_app_couch_query(app_id, opt);
2025
2028
  }
2026
2029
 
2027
- const ret =
2028
- drive_type === "user"
2029
- ? await db_module.find_couch_query("xuda_drive", opt)
2030
- : await db_module.find_app_couch_query(app_id, opt);
2031
2030
  for await (let doc of ret.docs) {
2032
2031
  if (doc.type === "directory") {
2033
2032
  await calculateSizeDocs(path.join("/", doc._id));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.508",
3
+ "version": "1.1.510",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {