bump version

This commit is contained in:
undefined committed 2024-10-24 06:50:18 +08:00
1 parent f7b1ca5b93
commit 3c642de4e6
11 files changed
+19 -204

No files matched your search

+7 -1
View File
@@ -109,7 +109,7 @@ export class ProblemMainHandler extends Handler {
const psdict = {};
const search = global.Hydro.lib.problemSearch || defaultSearch;
const parsed = parser.parse(q, {
keywords: ['category', 'difficulty'],
keywords: ['category', 'difficulty', 'namespace'],
offsets: false,
alwaysArray: true,
tokenize: true,
@@ -120,6 +120,12 @@ export class ProblemMainHandler extends Handler {
query.difficulty = { $in: parsed.difficulty.map(Number) };
}
if (category.length) query.$and = category.map((tag) => ({ tag }));
if (parsed.namespace?.length) {
const mappedPrefix = this.domain.namespaces?.[parsed.namespace[0]];
query.$and ||= [];
if (mappedPrefix) query.$and.push({ sort: new RegExp(`^${mappedPrefix}-`) });
else query.$and.push({ tag: parsed.namespace[0] });
}
if (text) category.push(text);
if (category.length) this.UiContext.extraTitleContent = category.join(',');
let total = 0;