@xuda.io/drive_module 1.1.490 → 1.1.491
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 +0 -21
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1873,29 +1873,8 @@ exports.get_drive_size = async function (req) {
|
|
|
1873
1873
|
"/"
|
|
1874
1874
|
);
|
|
1875
1875
|
|
|
1876
|
-
// async function getFolderSize(folderPath) {
|
|
1877
|
-
// let totalSize = 0;
|
|
1878
|
-
|
|
1879
|
-
// async function calculateSize(dirPath) {
|
|
1880
|
-
// const entries = await fse.readdir(dirPath, { withFileTypes: true });
|
|
1881
|
-
// for (let entry of entries) {
|
|
1882
|
-
// const fullPath = path.join(dirPath, entry.name);
|
|
1883
|
-
// if (entry.isDirectory()) {
|
|
1884
|
-
// await calculateSize(fullPath);
|
|
1885
|
-
// } else {
|
|
1886
|
-
// const fileStats = await fse.stat(fullPath);
|
|
1887
|
-
// totalSize += fileStats.size;
|
|
1888
|
-
// }
|
|
1889
|
-
// }
|
|
1890
|
-
// }
|
|
1891
|
-
|
|
1892
|
-
// await calculateSize(folderPath);
|
|
1893
|
-
// return totalSize;
|
|
1894
|
-
// }
|
|
1895
|
-
|
|
1896
1876
|
const size = await get_folder_size(directoryPath, drive_type, app_id);
|
|
1897
1877
|
|
|
1898
|
-
// console.log(`Total size of folder "${directoryPath}" is ${size} bytes.`);
|
|
1899
1878
|
return { code: 200, data: size };
|
|
1900
1879
|
} catch (err) {
|
|
1901
1880
|
return { code: -200, data: err.message };
|