fix: reuse background overlay across mpv reconnects

This commit is contained in:
2026-03-08 16:02:57 -07:00
parent 93cd688625
commit 6a44b54b51
2 changed files with 12 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import { fail, log } from '../log.js';
import { commandExists, isYoutubeTarget, realpathMaybe, resolvePathMaybe } from '../util.js';
import { collectVideos, showFzfMenu, showRofiMenu } from '../picker.js';
import {
loadSubtitleIntoMpv,
cleanupPlaybackSession,
startMpv,
startOverlay,
state,
@@ -264,9 +264,10 @@ export async function runPlaybackCommand(context: LauncherCommandContext): Promi
}
const finalize = (code: number | null | undefined) => {
stopOverlay(args);
processAdapter.setExitCode(code ?? 0);
resolve();
void cleanupPlaybackSession(args).finally(() => {
processAdapter.setExitCode(code ?? 0);
resolve();
});
};
if (mpvProc.exitCode !== null && mpvProc.exitCode !== undefined) {