core: fix additional_file indexing

This commit is contained in:
undefined committed 2021-04-01 13:23:03 +08:00
1 parent fbfd979bf7
commit b2dc46f108
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.20.51",
"version": "2.20.52",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
@@ -8,7 +8,7 @@ export async function run({ domainId }, report: Function) {
report({ message: `${pdoc.domainId}/${pdoc.docId}` });
const [data, additional_file] = await Promise.all([
storage.list(`problem/${pdoc.domainId}/${pdoc.docId}/testdata/`),
storage.list(`problem/${pdoc.domainId}/${pdoc.docId}/additional_files/`),
storage.list(`problem/${pdoc.domainId}/${pdoc.docId}/additional_file/`),
]) as any;
for (let i = 0; i < data.length; i++) {
data[i]._id = data[i].name;