@xuda.io/drive_module 1.1.866 → 1.1.868
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 +20 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1711,12 +1711,14 @@ exports.search_drive_files = async function (req) {
|
|
|
1711
1711
|
mime_type,
|
|
1712
1712
|
file_ext,
|
|
1713
1713
|
type,
|
|
1714
|
-
|
|
1714
|
+
|
|
1715
1715
|
sort_by = "name",
|
|
1716
1716
|
sort_dir = "desc",
|
|
1717
1717
|
path = "/",
|
|
1718
1718
|
} = req;
|
|
1719
1719
|
|
|
1720
|
+
let { tags = [] } = req;
|
|
1721
|
+
|
|
1720
1722
|
let { limit = 100 } = req;
|
|
1721
1723
|
|
|
1722
1724
|
const sort_by_obj = { name: "originalname", date: "date_created" };
|
|
@@ -1733,19 +1735,24 @@ exports.search_drive_files = async function (req) {
|
|
|
1733
1735
|
var tagKey = val.split(":")[0];
|
|
1734
1736
|
var tagVal = val.split(":")[1];
|
|
1735
1737
|
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
if (tagKey === "tag") {
|
|
1740
|
-
if (ret.$or.some((e) => e.tags))
|
|
1741
|
-
ret.$or.push({ tags: { $in: tagVal } });
|
|
1742
|
-
}
|
|
1738
|
+
if (tagKey === "tag") {
|
|
1739
|
+
tags.push(tagVal);
|
|
1740
|
+
}
|
|
1743
1741
|
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1742
|
+
if (tagKey === "name") {
|
|
1743
|
+
ret.$or.push(
|
|
1744
|
+
{
|
|
1745
|
+
ocr: {
|
|
1746
|
+
$regex: `(?i)${new_search}`,
|
|
1747
|
+
},
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
originalname: {
|
|
1751
|
+
$regex: `(?i)${new_search}`,
|
|
1752
|
+
},
|
|
1753
|
+
}
|
|
1754
|
+
);
|
|
1755
|
+
// ret.$or.push({ name: { $regex: tagVal } });
|
|
1749
1756
|
}
|
|
1750
1757
|
|
|
1751
1758
|
return ret;
|