fix(media): preserve yt-dlp output names

This commit is contained in:
NimBold
2026-07-01 14:45:55 +03:30
parent fdca17910a
commit 6b7eaa1f66
5 changed files with 99 additions and 31 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type DownloadStateEvent = { id: string, status: string, error: string | null, };
export type DownloadStateEvent = { id: string, status: string, error: string | null, fileName?: string, };
+5
View File
@@ -4,6 +4,7 @@ import type { DownloadProgressEvent } from '../bindings/DownloadProgressEvent';
import type { DownloadStatus } from '../bindings/DownloadStatus';
import { listenEvent as listen } from '../ipc';
import type { DownloadItem } from '../bindings/DownloadItem';
import { categoryForFileName } from '../utils/downloads';
interface DownloadProgressState {
progressMap: Record<string, DownloadProgressEvent>;
@@ -70,6 +71,10 @@ export async function initDownloadListener() {
status,
...(progress ? { fraction: progress.fraction } : {})
};
if (payload.fileName && payload.fileName !== current.fileName) {
updates.fileName = payload.fileName;
updates.category = categoryForFileName(payload.fileName);
}
if (status !== 'downloading') {
updates.speed = '-';
updates.eta = '-';