@xuda.io/drive_module 1.1.887 → 1.1.889
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 +6 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -91,8 +91,6 @@ exports.get_drive_files = async function (req) {
|
|
|
91
91
|
uid,
|
|
92
92
|
type,
|
|
93
93
|
date,
|
|
94
|
-
mime_type,
|
|
95
|
-
file_ext,
|
|
96
94
|
search_string,
|
|
97
95
|
sort_by = "name",
|
|
98
96
|
sort_dir = "desc",
|
|
@@ -117,7 +115,6 @@ exports.get_drive_files = async function (req) {
|
|
|
117
115
|
}
|
|
118
116
|
|
|
119
117
|
if (search_string) {
|
|
120
|
-
// var og_search = ""
|
|
121
118
|
tags_query = search_string
|
|
122
119
|
.split(" ")
|
|
123
120
|
.filter((e) => e.includes(":"))
|
|
@@ -133,6 +130,12 @@ exports.get_drive_files = async function (req) {
|
|
|
133
130
|
if (tagKey === "name") {
|
|
134
131
|
ret.$or.push({ originalname: { $regex: `(?i)${tagVal}` } });
|
|
135
132
|
}
|
|
133
|
+
if (tagKey === "mime") {
|
|
134
|
+
ret.$or.push({ mime: { $regex: `(?i)${tagVal}` } });
|
|
135
|
+
}
|
|
136
|
+
if (tagKey === "ext") {
|
|
137
|
+
ret.$or.push({ file_ext: { $regex: `(?i)${tagVal}` } });
|
|
138
|
+
}
|
|
136
139
|
|
|
137
140
|
return ret;
|
|
138
141
|
},
|