Decouple stats daemon and preserve final mine OSD status

- Run `subminer stats -b` as a dedicated daemon process, independent from the overlay app
- Stop Anki progress spinner before showing final `✓`/`x` mine result so it is not overwritten
- Keep grammar/noise subtitle tokens hoverable while stripping annotation metadata
This commit is contained in:
2026-03-18 23:49:27 -07:00
parent 4d96ebf5c0
commit a954f62f55
32 changed files with 1879 additions and 78 deletions

View File

@@ -45,6 +45,8 @@ export function parseMpvArgString(input: string): string[] {
let inSingleQuote = false;
let inDoubleQuote = false;
let escaping = false;
const canEscape = (nextChar: string | undefined): boolean =>
nextChar === undefined || nextChar === '"' || nextChar === "'" || nextChar === '\\' || /\s/.test(nextChar);
for (let i = 0; i < chars.length; i += 1) {
const ch = chars[i] || '';
@@ -65,7 +67,11 @@ export function parseMpvArgString(input: string): string[] {
if (inDoubleQuote) {
if (ch === '\\') {
escaping = true;
if (canEscape(chars[i + 1])) {
escaping = true;
} else {
current += ch;
}
continue;
}
if (ch === '"') {
@@ -77,7 +83,11 @@ export function parseMpvArgString(input: string): string[] {
}
if (ch === '\\') {
escaping = true;
if (canEscape(chars[i + 1])) {
escaping = true;
} else {
current += ch;
}
continue;
}
if (ch === "'") {
@@ -857,8 +867,14 @@ export function runAppCommandAttached(
proc.once('error', (error) => {
reject(error);
});
proc.once('exit', (code) => {
resolve(code ?? 0);
proc.once('exit', (code, signal) => {
if (code !== null) {
resolve(code);
} else if (signal) {
resolve(128);
} else {
resolve(0);
}
});
});
}