Skip to content

Commit

Permalink
use meter-core parsed_log_version
Browse files Browse the repository at this point in the history
  • Loading branch information
Herysia committed Apr 27, 2023
1 parent c375699 commit 43bbc65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src-electron/log-parser/file-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import { mainFolder, parsedLogFolder } from "../util/directories";
import { ReplayLogger } from "meter-core/logger/logger";
import { Parser } from "meter-core/logger/parser";
import { MeterData } from "meter-core/data";
import { GameState } from "meter-core/logger/data";
import { GameState, PARSED_LOG_VERSION } from "meter-core/logger/data";
import { randomUUID } from "crypto";

dayjs.extend(customParseFormat);

const LOG_PARSER_VERSION = 15;

export async function parseLogs(
event: IpcMainEvent,
splitOnPhaseTransition: boolean,
Expand Down Expand Up @@ -66,7 +64,7 @@ export async function parseLogs(
if (
new Date(mainJson[filename].mtime).getTime() <
new Date(logStats.mtime).getTime() ||
mainJson[filename].logParserVersion < LOG_PARSER_VERSION
mainJson[filename].logParserVersion < PARSED_LOG_VERSION
) {
shouldUnlink = true;
}
Expand Down Expand Up @@ -107,7 +105,7 @@ export async function parseLogs(
} else {
mainJson[filename] = {
mtime: new Date(logStats.mtime),
logParserVersion: LOG_PARSER_VERSION,
logParserVersion: PARSED_LOG_VERSION,
};
}

Expand Down

0 comments on commit 43bbc65

Please sign in to comment.