mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🐛 修复导出字段数据缺失
This commit is contained in:
@@ -41,8 +41,7 @@
|
||||
"status": {
|
||||
"type": "number",
|
||||
"description": "Finished status",
|
||||
"enum": [0, 1, 2, 3],
|
||||
"enumDesc": "ACHIEVEMENT_INVALID = 0; ACHIEVEMENT_UNFINISHED = 1; ACHIEVEMENT_FINISHED = 2;ACHIEVEMENT_POINT_TAKEN = 3;"
|
||||
"enum": [0, 1, 2, 3]
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "number",
|
||||
|
||||
@@ -141,10 +141,12 @@ async function updateAchievement(data: TGApp.Sqlite.Achievement.SingleTable): Pr
|
||||
*/
|
||||
function transDb2Uiaf(data: TGApp.Sqlite.Achievement.SingleTable): TGApp.Plugins.UIAF.Achievement {
|
||||
const isCompleted = data.isCompleted === 1;
|
||||
let timestamp = 0;
|
||||
if (isCompleted) timestamp = new Date(data.completedTime).getTime();
|
||||
const status = getUiafStatus(isCompleted, data.progress);
|
||||
return {
|
||||
id: data.id,
|
||||
timestamp: data.timestamp,
|
||||
timestamp: timestamp,
|
||||
current: data.progress,
|
||||
status,
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ export async function getUiafHeader(): Promise<TGApp.Plugins.UIAF.Export> {
|
||||
*/
|
||||
export async function verifyUiafData(path: string): Promise<boolean> {
|
||||
const fileData: string = await fs.readTextFile(path);
|
||||
const ajv = new Ajv({ strict: false });
|
||||
const ajv = new Ajv();
|
||||
const validate = ajv.compile(UiafSchema);
|
||||
try {
|
||||
const fileJson = JSON.parse(fileData);
|
||||
|
||||
Reference in New Issue
Block a user