fix: preserve failed media queue item

This commit is contained in:
MythEclipse
2026-05-15 17:01:51 +07:00
parent 3b6bf49160
commit 2194d4a8b6
2 changed files with 13 additions and 4 deletions

View File

@@ -38,11 +38,11 @@ export class MediaQueue {
this.current = null;
}
failCurrent(): void {
if (this.current) {
this.current = { ...this.current, status: "failed" };
}
failCurrent(): MediaQueueItem | null {
if (!this.current) return null;
const failed = { ...this.current, status: "failed" as const };
this.current = null;
return failed;
}
clear(): void {