diff --git a/server/src/lib/score-import/import-types/file/solid-state-squad/parser.ts b/server/src/lib/score-import/import-types/file/solid-state-squad/parser.ts index 9dc01acaf..8a084063e 100644 --- a/server/src/lib/score-import/import-types/file/solid-state-squad/parser.ts +++ b/server/src/lib/score-import/import-types/file/solid-state-squad/parser.ts @@ -66,7 +66,7 @@ const PR_SOLID_STATE: PrudenceSchema = { const xmlParser = new XMLParser(); // .59 is a song that is interpreted as a float by our XML parser. -type PreStringifiedS3Score = Omit & { songname: 0.59 | string }; +type PreStringifiedS3Score = Omit & { songname: string | 0.59 }; export function ParseSolidStateXML( fileData: Express.Multer.File, @@ -117,10 +117,11 @@ export function ParseSolidStateXML( throw new ScoreImportFatalError(400, FormatPrError(err, "Invalid S3 XML.")); } - let scoreData = parsedXML.s3data.scoredata.song as PreStringifiedS3Score[]; + let scoreData = maybeSongs as Array; scoreData = scoreData.map((e) => ({ ...e, + // Songnames here are either numbers or strings due to a disgusting hack // @see #718 // We forcibly convert all these back to strings. @@ -133,7 +134,7 @@ export function ParseSolidStateXML( return { classHandler: null, context: {}, - iterable: maybeSongs as Array, + iterable: scoreData as Array, game: "iidx", }; }