mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 02:48:01 +03:00
We should also apply these changes to any other instance of timeAchieved: Date.now(),
This commit is contained in:
@@ -16,11 +16,11 @@ import { ClassHandler } from "../../framework/user-game-stats/types";
|
||||
import { SDVXEamusementCSVData } from "../file/eamusement-sdvx-csv/types";
|
||||
import { MerScore } from "../file/mer-iidx/types";
|
||||
import { S3Score } from "../file/solid-state-squad/types";
|
||||
import { BarbatosScore } from "../ir/barbatos/types";
|
||||
import { BarbatosContext, BarbatosScore } from "../ir/barbatos/types";
|
||||
import { BeatorajaContext, BeatorajaScore } from "../ir/beatoraja/types";
|
||||
import { FervidexStaticContext, FervidexStaticScore } from "../ir/fervidex-static/types";
|
||||
import { FervidexContext, FervidexScore } from "../ir/fervidex/types";
|
||||
import { KsHookSV3CScore } from "../ir/kshook-sv3c/types";
|
||||
import { KsHookSV3CContext, KsHookSV3CScore } from "../ir/kshook-sv3c/types";
|
||||
import { IRUSCContext } from "../ir/usc/types";
|
||||
import { KaiContext } from "./api-kai/types";
|
||||
import { BatchManualContext } from "./batch-manual/types";
|
||||
@@ -62,12 +62,12 @@ export interface ImportTypeContextMap {
|
||||
"file/pli-iidx-csv": IIDXEamusementCSVContext;
|
||||
|
||||
"ir/direct-manual": BatchManualContext;
|
||||
"ir/barbatos": EmptyObject;
|
||||
"ir/barbatos": BarbatosContext;
|
||||
"ir/fervidex": FervidexContext;
|
||||
"ir/fervidex-static": FervidexStaticContext;
|
||||
"ir/beatoraja": BeatorajaContext;
|
||||
"ir/usc": IRUSCContext;
|
||||
"ir/kshook-sv3c": EmptyObject;
|
||||
"ir/kshook-sv3c": KsHookSV3CContext;
|
||||
|
||||
"api/arc-iidx": EmptyObject;
|
||||
"api/arc-sdvx": EmptyObject;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Lamps } from "tachi-common";
|
||||
import { FindSDVXChartOnInGameID } from "utils/queries/charts";
|
||||
import { FindSongOnID } from "utils/queries/songs";
|
||||
import { EmptyObject } from "utils/types";
|
||||
import {
|
||||
InternalFailure,
|
||||
KTDataNotFoundFailure,
|
||||
@@ -9,7 +8,7 @@ import {
|
||||
import { GenericGetGradeAndPercent } from "../../../framework/common/score-utils";
|
||||
import { DryScore } from "../../../framework/common/types";
|
||||
import { ConverterFunction } from "../../common/types";
|
||||
import { BarbatosScore } from "./types";
|
||||
import { BarbatosContext, BarbatosScore } from "./types";
|
||||
|
||||
const LAMP_LOOKUP = {
|
||||
1: "FAILED",
|
||||
@@ -27,7 +26,7 @@ const DIFFICULTY_LOOKUP = {
|
||||
4: "MXM",
|
||||
};
|
||||
|
||||
export const ConverterIRBarbatos: ConverterFunction<BarbatosScore, EmptyObject> = async (
|
||||
export const ConverterIRBarbatos: ConverterFunction<BarbatosScore, BarbatosContext> = async (
|
||||
data,
|
||||
context,
|
||||
importType,
|
||||
@@ -65,7 +64,7 @@ export const ConverterIRBarbatos: ConverterFunction<BarbatosScore, EmptyObject>
|
||||
service: "Barbatos",
|
||||
comment: null,
|
||||
importType: "ir/barbatos",
|
||||
timeAchieved: Date.now(),
|
||||
timeAchieved: context.timeReceived,
|
||||
scoreData: {
|
||||
score: data.score,
|
||||
percent,
|
||||
|
||||
@@ -17,3 +17,7 @@ export interface BarbatosScore {
|
||||
gauge_type: 1 | 2;
|
||||
is_skill_analyzer: boolean;
|
||||
}
|
||||
|
||||
export interface BarbatosContext {
|
||||
timeReceived: number;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export const ConverterIRFervidex: ConverterFunction<FervidexScore, FervidexConte
|
||||
service: "Fervidex",
|
||||
comment: null,
|
||||
importType: "ir/fervidex",
|
||||
timeAchieved: Date.now(),
|
||||
timeAchieved: context.timeReceived,
|
||||
scoreData: {
|
||||
score: data.ex_score,
|
||||
percent,
|
||||
|
||||
@@ -60,4 +60,5 @@ export interface FervidexScore {
|
||||
|
||||
export interface FervidexContext {
|
||||
version: GPTSupportedVersions["iidx:SP" | "iidx:DP"];
|
||||
timeReceived: number;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,10 @@ import { DryScore } from "lib/score-import/framework/common/types";
|
||||
import { Lamps } from "tachi-common";
|
||||
import { FindSDVXChartOnInGameIDVersion } from "utils/queries/charts";
|
||||
import { FindSongOnID } from "utils/queries/songs";
|
||||
import { EmptyObject } from "utils/types";
|
||||
import { ConverterFunction } from "../../common/types";
|
||||
import { KsHookSV3CScore } from "./types";
|
||||
import { KsHookSV3CContext, KsHookSV3CScore } from "./types";
|
||||
|
||||
export const ConverterIRKsHookSV3C: ConverterFunction<KsHookSV3CScore, EmptyObject> = async (
|
||||
export const ConverterIRKsHookSV3C: ConverterFunction<KsHookSV3CScore, KsHookSV3CContext> = async (
|
||||
data,
|
||||
context,
|
||||
importType,
|
||||
@@ -44,7 +43,7 @@ export const ConverterIRKsHookSV3C: ConverterFunction<KsHookSV3CScore, EmptyObje
|
||||
service: "kshook SV3C",
|
||||
comment: null,
|
||||
importType: "ir/kshook-sv3c",
|
||||
timeAchieved: Date.now(),
|
||||
timeAchieved: context.timeReceived,
|
||||
scoreData: {
|
||||
score: data.score,
|
||||
percent,
|
||||
|
||||
@@ -3,9 +3,8 @@ import { KtLogger } from "lib/logger/logger";
|
||||
import ScoreImportFatalError from "lib/score-import/framework/score-importing/score-import-error";
|
||||
import p, { PrudenceSchema } from "prudence";
|
||||
import { FormatPrError } from "utils/prudence";
|
||||
import { EmptyObject } from "utils/types";
|
||||
import { ParserFunctionReturns } from "../../common/types";
|
||||
import { KsHookSV3CScore } from "./types";
|
||||
import { KsHookSV3CContext, KsHookSV3CScore } from "./types";
|
||||
|
||||
const PR_KsHookSV3C: PrudenceSchema = {
|
||||
appeal_id: p.isPositiveInteger,
|
||||
@@ -75,7 +74,7 @@ const PR_KsHookSV3C: PrudenceSchema = {
|
||||
export function ParseKsHookSV3C(
|
||||
body: Record<string, unknown>,
|
||||
logger: KtLogger
|
||||
): ParserFunctionReturns<KsHookSV3CScore, EmptyObject> {
|
||||
): ParserFunctionReturns<KsHookSV3CScore, KsHookSV3CContext> {
|
||||
// Ignore excess keys, as SV3C might add more features in the future.
|
||||
const err = p(body, PR_KsHookSV3C, undefined, { allowExcessKeys: true });
|
||||
|
||||
@@ -88,7 +87,9 @@ export function ParseKsHookSV3C(
|
||||
return {
|
||||
game: "sdvx",
|
||||
iterable: [score],
|
||||
context: {},
|
||||
context: {
|
||||
timeReceived: Date.now(),
|
||||
},
|
||||
classHandler: () => {
|
||||
const skillLevel = ConvertSkillLevel(score.skill_level);
|
||||
|
||||
|
||||
@@ -56,3 +56,7 @@ export interface KsHookSV3CScore {
|
||||
skill_name: integer;
|
||||
track_no: integer;
|
||||
}
|
||||
|
||||
export interface KsHookSV3CContext {
|
||||
timeReceived: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user