@xuda.io/drive_module 1.1.776 → 1.1.778
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
|
@@ -2542,7 +2542,13 @@ setTimeout(async function () {
|
|
|
2542
2542
|
// );
|
|
2543
2543
|
}, 2000);
|
|
2544
2544
|
|
|
2545
|
-
const get_drive_doc = async function (
|
|
2545
|
+
const get_drive_doc = async function (
|
|
2546
|
+
drive_type,
|
|
2547
|
+
app_id,
|
|
2548
|
+
uid,
|
|
2549
|
+
file_path,
|
|
2550
|
+
headers
|
|
2551
|
+
) {
|
|
2546
2552
|
let check_req = {
|
|
2547
2553
|
app_id,
|
|
2548
2554
|
uid,
|
|
@@ -2583,17 +2589,18 @@ const get_drive_doc = async function (drive_type, app_id, uid, file_path) {
|
|
|
2583
2589
|
|
|
2584
2590
|
if (doc_ret.code < 0) {
|
|
2585
2591
|
if (drive_type === "studio") {
|
|
2592
|
+
const file_name = path.basename(file_path);
|
|
2586
2593
|
const ext = path.extname(file_name).toLowerCase();
|
|
2587
2594
|
doc = {
|
|
2588
2595
|
_id: file_name,
|
|
2589
|
-
docType:
|
|
2596
|
+
docType: `studio_drive`,
|
|
2590
2597
|
stat: 3,
|
|
2591
2598
|
server_file_name: file_name,
|
|
2592
2599
|
originalname: file_name,
|
|
2593
2600
|
uid,
|
|
2594
2601
|
date_created: Date.now(),
|
|
2595
|
-
ip: headers["cf-connecting-ip"],
|
|
2596
|
-
country: headers["cf-ipcountry"],
|
|
2602
|
+
ip: headers?.["cf-connecting-ip"],
|
|
2603
|
+
country: headers?.["cf-ipcountry"],
|
|
2597
2604
|
file_ext: ext,
|
|
2598
2605
|
is_archive: _conf.archive_drive_ext.includes(ext) ? true : false,
|
|
2599
2606
|
drive_type,
|