From c80ce1ed7910a70a126e86dd27170e754c05b38e Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 17 Aug 2021 22:24:13 +0800 Subject: [PATCH] core: remove unused vars --- packages/hydrooj/src/handler/problem.ts | 6 +++--- packages/import-qduoj/handler.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 07b332259..e1a9ccca5 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -419,11 +419,11 @@ export class ProblemFileDownloadHandler extends ProblemDetailHandler { const file = await storage.getMeta(target); if (!file) throw new NotFoundError(filename); this.response.etag = file.etag; - const type = lookup(filename).toString(); - const shouldProxy = ['image', 'video', 'audio', 'pdf', 'vnd'].filter((i) => type.includes(i)).length; + const fileType = lookup(filename).toString(); + const shouldProxy = ['image', 'video', 'audio', 'pdf', 'vnd'].filter((i) => fileType.includes(i)).length; if (shouldProxy && file.size! < 32 * 1024 * 1024) { this.response.body = await storage.get(target); - this.response.type = file['Content-Type'] || type; + this.response.type = file['Content-Type'] || fileType; if (!noDisposition) this.response.addHeader('Content-Disposition', `attachment; filename=${filename}`); } else { this.response.redirect = await storage.signDownloadLink( diff --git a/packages/import-qduoj/handler.ts b/packages/import-qduoj/handler.ts index 43b3126ba..b527eafa1 100644 --- a/packages/import-qduoj/handler.ts +++ b/packages/import-qduoj/handler.ts @@ -5,7 +5,7 @@ import fs from 'fs-extra'; import AdmZip from 'adm-zip'; import yaml from 'js-yaml'; import { Route, Handler } from 'hydrooj/src/service/server'; -import { BadRequestError, ValidationError } from 'hydrooj/src/error'; +import { ValidationError } from 'hydrooj/src/error'; import { ProblemAdd } from 'hydrooj/src/lib/ui'; import problem from 'hydrooj/src/model/problem'; import { PERM } from 'hydrooj/src/model/builtin';