@xuda.io/drive_module 1.1.912 → 1.1.914
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 +10 -18
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1697,14 +1697,20 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1697
1697
|
};
|
|
1698
1698
|
|
|
1699
1699
|
const ocr_drive_file = async function (doc) {
|
|
1700
|
-
const { drive_type, target_file, app_id } = doc;
|
|
1700
|
+
const { drive_type, target_file, app_id, uid } = doc;
|
|
1701
1701
|
|
|
1702
1702
|
try {
|
|
1703
1703
|
doc.ocr_stat = 2;
|
|
1704
1704
|
doc.ocr_stat_date = Date.now();
|
|
1705
|
-
|
|
1705
|
+
let save_ret = await save_drive_doc(drive_type, app_id, doc, file_path);
|
|
1706
1706
|
|
|
1707
|
-
doc = await get_drive_doc(
|
|
1707
|
+
doc = await get_drive_doc(
|
|
1708
|
+
"file",
|
|
1709
|
+
drive_type,
|
|
1710
|
+
app_id,
|
|
1711
|
+
uid,
|
|
1712
|
+
path.join(file_path, originalname)
|
|
1713
|
+
);
|
|
1708
1714
|
|
|
1709
1715
|
var ocr = "";
|
|
1710
1716
|
|
|
@@ -1785,21 +1791,7 @@ const ocr_drive_file = async function (doc) {
|
|
|
1785
1791
|
} finally {
|
|
1786
1792
|
doc.ocr_stat_ts = Date.now();
|
|
1787
1793
|
|
|
1788
|
-
|
|
1789
|
-
switch (drive_type) {
|
|
1790
|
-
case "workspace":
|
|
1791
|
-
case "studio":
|
|
1792
|
-
const app_id_reference = await _common.get_project_app_id(doc.app_id);
|
|
1793
|
-
await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
1794
|
-
break;
|
|
1795
|
-
|
|
1796
|
-
case "user":
|
|
1797
|
-
await db_module.save_couch_doc("xuda_drive", doc);
|
|
1798
|
-
break;
|
|
1799
|
-
|
|
1800
|
-
default:
|
|
1801
|
-
break;
|
|
1802
|
-
}
|
|
1794
|
+
save_ret = await save_drive_doc(drive_type, app_id, doc, file_path);
|
|
1803
1795
|
}
|
|
1804
1796
|
};
|
|
1805
1797
|
|