@xuda.io/drive_module 1.1.497 → 1.1.499

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 +7 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1856,7 +1856,7 @@ exports.search_drive_files = async function (req) {
1856
1856
  exports.get_drive_size = async function (req) {
1857
1857
  try {
1858
1858
  const { drive_type, app_id, uid } = req;
1859
-
1859
+ let size = 0;
1860
1860
  // validate_drive_type(drive_type);
1861
1861
 
1862
1862
  var ref;
@@ -1866,12 +1866,6 @@ exports.get_drive_size = async function (req) {
1866
1866
  ref = await _common.get_project_app_id(app_id, true);
1867
1867
  }
1868
1868
 
1869
- const directoryPath = path.join(
1870
- _conf[`${drive_type}_drive_path`],
1871
- ref,
1872
- "/"
1873
- );
1874
-
1875
1869
  switch (drive_type) {
1876
1870
  case "user":
1877
1871
  break;
@@ -1879,11 +1873,15 @@ exports.get_drive_size = async function (req) {
1879
1873
  break;
1880
1874
 
1881
1875
  default:
1876
+ const directoryPath = path.join(
1877
+ _conf[`${drive_type}_drive_path`],
1878
+ ref,
1879
+ "/"
1880
+ );
1881
+ size = await get_folder_size(directoryPath, drive_type, app_id);
1882
1882
  break;
1883
1883
  }
1884
1884
 
1885
- const size = await get_folder_size(directoryPath, drive_type, app_id);
1886
-
1887
1885
  return { code: 200, data: size };
1888
1886
  } catch (err) {
1889
1887
  return { code: -200, data: err.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.497",
3
+ "version": "1.1.499",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {