Skip to content

Commit

Permalink
Update danmaku regex pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Nov 18, 2024
1 parent aae4b4b commit 2f85cea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ function migrateOldSyncFormats(config: SBConfig) {
if (config["serverAddress"].includes("47.103.74.95")) {
config["serverAddress"] = CompileConfig.serverAddress;
}

// danmaku regex update since 0.5.0
const oldDanmakuRegexPatterns = [
"(?:空降\\s*)?(\\d{1,2}):(\\d{1,2})(?::(\\d{1,2}))?", // 0.5.0
];
if (oldDanmakuRegexPatterns.includes(config["danmakuRegexPattern"])) {
config["danmakuRegexPattern"] = syncDefaults.danmakuRegexPattern;
}
}

const syncDefaults = {
Expand All @@ -207,7 +215,7 @@ const syncDefaults = {
enableDanmakuSkip: false,
enableAutoSkipDanmakuSkip: false,
enableMenuDanmakuSkip: false,
danmakuRegexPattern: "(?:空降\\s*)?(\\d{1,2}):(\\d{1,2})(?::(\\d{1,2}))?",
danmakuRegexPattern: "(?:空降\\s*)?(\\d{1,2})[::](\\d{1,2})(?:[::](\\d{1,2}))?$",
checkTimeDanmakuSkip: true,

muteSegments: true,
Expand Down

0 comments on commit 2f85cea

Please sign in to comment.