@xuda.io/drive_module 1.1.1012 → 1.1.1014

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 +16 -14
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -133,8 +133,9 @@ exports.get_drive_files = async function (req) {
133
133
 
134
134
  if (tagKey === "tag") {
135
135
  tags.push(tagVal);
136
+ return;
136
137
  }
137
-
138
+ mix_conditions = true;
138
139
  if (tagKey === "name") {
139
140
  ret.$or.push({ originalname: { $regex: `(?i)${tagVal}` } });
140
141
  }
@@ -157,21 +158,22 @@ exports.get_drive_files = async function (req) {
157
158
  .filter((e) => !e.includes(":"))
158
159
  .filter((e) => e)
159
160
  .join(" ");
160
-
161
- tags_query.$or = [
162
- ...tags_query.$or,
163
- {
164
- ocr: {
165
- $regex: `(?i)${new_search}`,
161
+ if (mix_conditions) {
162
+ tags_query.$or = [
163
+ ...tags_query.$or,
164
+ {
165
+ ocr: {
166
+ $regex: `(?i)${new_search}`,
167
+ },
166
168
  },
167
- },
168
- {
169
- originalname: {
170
- $regex: `(?i)${new_search}`,
169
+ {
170
+ originalname: {
171
+ $regex: `(?i)${new_search}`,
172
+ },
171
173
  },
172
- },
173
- ];
174
- opt.selector = { ...opt.selector, ...tags_query };
174
+ ];
175
+ opt.selector = { ...opt.selector, ...tags_query };
176
+ }
175
177
  }
176
178
 
177
179
  if (tags?.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.1012",
3
+ "version": "1.1.1014",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {