Fix now-playing scraper, quit hang, tray icon, and tray race (v1.0.1)

- Read the track from the Media Session API, falling back to the legacy
  ytmusic-player-bar scrape. Current YT Music layouts render no player bar,
  so the API and tray stayed empty while music played. Artist is also clean
  now (no "• views • likes" suffix).
- Terminate connected WebSocket clients before closing the server. ws's
  close() waits for every client to disconnect, so quitting with an overlay
  open hung forever, leaving the window playing and the port bound.
- Replace the tray icon with a valid PNG (the old one had a bad IDAT CRC and
  decoded to an empty image) and test that its chunks are well formed.
- Create the tray before the window so early state updates are not dropped.
- Bump version to 1.0.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 11:37:38 -07:00
co-authored by Claude Sonnet 5.5
parent f73ea93dde
commit e49078ee03
11 changed files with 192 additions and 54 deletions
+5 -2
View File
@@ -67,8 +67,8 @@ app.whenReady().then(async () => {
if (tray) tray.update({ title: next.title, artist: next.artist });
});
await createWindow();
// Create the tray before the window: the scraper can report a track as soon as
// the page loads, and state arriving while `tray` is null would be dropped.
tray = createTray({
port: serverHandle.port,
onShow: () => {
@@ -78,6 +78,9 @@ app.whenReady().then(async () => {
},
onQuit: () => app.quit(),
});
await createWindow();
}).catch((err) => {
dialog.showErrorBox('Failed to start', err && err.message ? err.message : String(err));
app.exit(1);