@xuda.io/drive_module 1.1.849 → 1.1.850

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 +23 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1721,15 +1721,38 @@ exports.search_drive_files = async function (req) {
1721
1721
 
1722
1722
  const sort_by_obj = { name: "originalname", date: "date_created" };
1723
1723
 
1724
+ const protected_tags=["tag","name"]
1725
+
1726
+ if(protected_tags.includes(search_string)){
1727
+
1728
+ // var og_search = ""
1724
1729
  let search_obj = search_string.split(" ").reduce((ret, val) => {
1725
1730
  var tagKey = val.split(":")[0];
1726
1731
  var tagVal = val.split(":")[1];
1727
1732
 
1728
1733
  if (!ret[tagKey]) ret[tagKey] = [];
1734
+
1729
1735
  if (tagVal) {
1730
1736
  ret[tagKey].push({ $or: tagVal });
1737
+ } else{
1738
+ og_search += og_search
1731
1739
  }
1732
1740
 
1741
+ $or: [
1742
+ {
1743
+ ocr: {
1744
+ $regex: `(?i)${req.search_string}`,
1745
+ },
1746
+ },
1747
+ {
1748
+ originalname: {
1749
+ $regex: `(?i)${req.search_string}`,
1750
+ },
1751
+ },
1752
+ ],
1753
+ };
1754
+ }
1755
+
1733
1756
  return ret;
1734
1757
  }, {});
1735
1758
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.849",
3
+ "version": "1.1.850",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {