Fix L54/L61/L63: thumbnail error fallback, ipcMain.handle, audioQuality label

L54: DownloadBar preview image now tracks failed src in state (same pattern as
     MediaThumb); on load error shows the kind icon fallback instead of broken img.
L61: Convert taskbarProgress from ipcMain.on/ipcRenderer.send to ipcMain.handle/
     ipcRenderer.invoke so all IPC channels use the same request-response idiom.
     App.tsx calls void to explicitly discard the resolved promise.
L63: audioQuality() now has an explicit 'Best' case alongside the bitrate strings;
     unknown labels still fall back to '0' but the default branch is documented.

typecheck + 242 tests + eslint + prettier green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 13:45:45 -04:00
parent 9d816f0c86
commit ba208de98b
7 changed files with 26 additions and 13 deletions
+4 -1
View File
@@ -55,8 +55,11 @@ function audioQuality(quality: string): string {
return '192K'
case '128 kbps':
return '128K'
case 'Best':
return '0'
default:
return '0' // Best
// Unrecognised label — fall back to best (0) so the download still works.
return '0'
}
}
+2 -2
View File
@@ -427,8 +427,8 @@ function registerIpcHandlers(): void {
ipcMain.handle(IpcChannels.scheduledSyncGet, () => getScheduledSync())
ipcMain.handle(IpcChannels.scheduledSyncSet, (_e, enabled: boolean) => setScheduledSync(enabled))
// Reflect overall queue progress on the Windows taskbar (fire-and-forget).
ipcMain.on(IpcChannels.taskbarProgress, (_e, p: TaskbarProgress) => {
// Reflect overall queue progress on the Windows taskbar.
ipcMain.handle(IpcChannels.taskbarProgress, (_e, p: TaskbarProgress) => {
if (!mainWindow || mainWindow.isDestroyed()) return
if (p.mode === 'none') {
mainWindow.setProgressBar(-1)