mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-29 10:28:04 +03:00
feat: fervidex ch-omni enable
This commit is contained in:
@@ -101,11 +101,12 @@ export function SoftwareIDToVersion(model: string, logger: KtLogger) {
|
||||
} else if (data.ext === EXT_CASTHOUR) {
|
||||
if (data.rev === REV_NORMAL) {
|
||||
return "29";
|
||||
} else if (data.rev === REV_2DXTRA) {
|
||||
return "29-omni";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger.warn(`Unsupported Software Model ${model}.`);
|
||||
throw new ScoreImportFatalError(400, `Unsupported Software Model ${model}.`);
|
||||
} catch (err) {
|
||||
logger.warn(`Unsupported Software Model ${model}.`, { err });
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
import { SYMBOL_TACHI_API_AUTH } from "lib/constants/tachi";
|
||||
import CreateLogCtx from "lib/logger/logger";
|
||||
import { ExpressWrappedScoreImportMain } from "lib/score-import/framework/express-wrapper";
|
||||
import { SoftwareIDToVersion } from "lib/score-import/import-types/ir/fervidex/parser";
|
||||
import p from "prudence";
|
||||
import { RequirePermissions } from "server/middleware/auth";
|
||||
import { PrudenceErrorFormatter } from "server/middleware/prudence-validate";
|
||||
@@ -104,9 +105,12 @@ const ValidateModelHeader: RequestHandler = (req, res, next) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (softID.ext === undefined || !supportedExts.includes(softID.ext)) {
|
||||
try {
|
||||
SoftwareIDToVersion(swModel, logger);
|
||||
} catch (err) {
|
||||
logger.info(
|
||||
`Rejected invalid Software Model ${softID.ext} from user ${req[SYMBOL_TACHI_API_AUTH].userID}.`
|
||||
`Rejected invalid Software Model ${softID.ext} from user ${req[SYMBOL_TACHI_API_AUTH].userID}.`,
|
||||
{ err }
|
||||
);
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
|
||||
@@ -5,18 +5,20 @@ export function ParseEA3SoftID(ver: string) {
|
||||
throw new Error(`Invalid Version Code. Had ${a.length} components.`);
|
||||
}
|
||||
|
||||
const arr = a as [string, string, string, string, string];
|
||||
|
||||
if (!/^[A-Z0-9]{3}:[A-Z]:[A-Z]:[A-Z]:[0-9]{10}$/u.exec(ver)) {
|
||||
throw new Error(`Invalid Version Code.`);
|
||||
}
|
||||
|
||||
return {
|
||||
model: a[0],
|
||||
model: arr[0],
|
||||
|
||||
// region
|
||||
dest: a[1],
|
||||
dest: arr[1],
|
||||
|
||||
spec: a[2],
|
||||
rev: a[3],
|
||||
ext: a[4],
|
||||
spec: arr[2],
|
||||
rev: arr[3],
|
||||
ext: arr[4],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user