core&judge: support lang filter

This commit is contained in:
undefined committed 2023-12-15 09:49:40 +08:00
1 parent d121a7148a
commit 928bd9f467
3 files changed
+6 -3

No files matched your search

+2 -1
View File
@@ -183,9 +183,10 @@ export default class Hydro implements Session {
Authorization: `Bearer ${this.config.cookie.split('sid=')[1].split(';')[0]}`,
},
});
const config: { prio?: number, concurrency?: number } = {};
const config: { prio?: number, concurrency?: number, lang?: string[] } = {};
if (this.config.minPriority !== undefined) config.prio = this.config.minPriority;
if (this.config.concurrency !== undefined) config.concurrency = this.config.concurrency;
if (this.config.lang?.length) config.lang = this.config.lang;
const content = Object.keys(config).length
? JSON.stringify({ key: 'config', ...config })
: '{"key":"ping"}';