diff --git a/server/src/score-import/framework/score-import-main.ts b/server/src/score-import/framework/score-import-main.ts index db316721d..65b3b4c0e 100644 --- a/server/src/score-import/framework/score-import-main.ts +++ b/server/src/score-import/framework/score-import-main.ts @@ -35,11 +35,23 @@ export default async function ScoreImportMain( // Construct sessions from successful scores // @todo + let scoreIDs = []; + let errors = []; + + for (const info of importInfo) { + if (info.success) { + scoreIDs.push(info.content.score.scoreID); + } else { + errors.push({ type: info.type, message: info.message }); + } + } + // Create import document const ImportDocument: KTBlackImportDocument = { importType, idStrings: idStrings, - importInfo, + scoreIDs, + errors, importID, timeFinished: Date.now(), timeStarted, @@ -50,7 +62,9 @@ export default async function ScoreImportMain( logger.info( `Import took: ${ImportDocument.timeFinished - timeStarted}ms, with ${ importInfo.length - } documents. Aprx ${(ImportDocument.timeFinished - timeStarted) / importInfo.length}ms/doc` + } documents (Fails: ${errors.length}, Successes: ${scoreIDs.length}). Aprx ${ + (ImportDocument.timeFinished - timeStarted) / importInfo.length + }ms/doc` ); // Add this to the imports database