Compare commits
2 Commits
4518f8867a
...
1b8624d88a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b8624d88a | ||
|
|
77e4c84c45 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "twitch-vod-manager",
|
"name": "twitch-vod-manager",
|
||||||
"version": "4.6.56",
|
"version": "4.6.57",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "twitch-vod-manager",
|
"name": "twitch-vod-manager",
|
||||||
"version": "4.6.56",
|
"version": "4.6.57",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.6.0",
|
"axios": "^1.6.0",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "twitch-vod-manager",
|
"name": "twitch-vod-manager",
|
||||||
"version": "4.6.56",
|
"version": "4.6.57",
|
||||||
"description": "Twitch VOD Manager - Download Twitch VODs easily",
|
"description": "Twitch VOD Manager - Download Twitch VODs easily",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"author": "xRangerDE",
|
"author": "xRangerDE",
|
||||||
|
|||||||
30
src/main.ts
30
src/main.ts
@ -3750,26 +3750,32 @@ async function runLiveStatusBatchPoll(): Promise<void> {
|
|||||||
const logins = ((config.streamers as string[]) || [])
|
const logins = ((config.streamers as string[]) || [])
|
||||||
.map((s) => normalizeLogin(s))
|
.map((s) => normalizeLogin(s))
|
||||||
.filter((s): s is string => Boolean(s));
|
.filter((s): s is string => Boolean(s));
|
||||||
if (logins.length === 0) return;
|
|
||||||
|
|
||||||
const fresh = await fetchLiveStatusBatch(logins);
|
|
||||||
const changes: Array<{ login: string; isLive: boolean }> = [];
|
const changes: Array<{ login: string; isLive: boolean }> = [];
|
||||||
const seen = new Set(fresh.keys());
|
const watchedSet = new Set(logins);
|
||||||
for (const [login, isLive] of fresh.entries()) {
|
|
||||||
const prev = liveStatusByLogin.get(login);
|
// Always run the eviction pass FIRST — entries left over from a
|
||||||
if (prev !== isLive) changes.push({ login, isLive });
|
// streamer that's no longer in the watch list must go regardless
|
||||||
liveStatusByLogin.set(login, isLive);
|
// of whether we're about to fetch fresh data. Previously this
|
||||||
}
|
// ran inside the fetch branch only, so removing the last
|
||||||
// Streamers that vanished from the watch list (or that GQL didn't
|
// streamer left ghost entries in liveStatusByLogin until the
|
||||||
// return for) get evicted so a removed streamer doesn't leave a
|
// next add.
|
||||||
// ghost-live dot behind.
|
|
||||||
for (const oldLogin of Array.from(liveStatusByLogin.keys())) {
|
for (const oldLogin of Array.from(liveStatusByLogin.keys())) {
|
||||||
if (!seen.has(oldLogin)) {
|
if (!watchedSet.has(oldLogin)) {
|
||||||
liveStatusByLogin.delete(oldLogin);
|
liveStatusByLogin.delete(oldLogin);
|
||||||
changes.push({ login: oldLogin, isLive: false });
|
changes.push({ login: oldLogin, isLive: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (logins.length > 0) {
|
||||||
|
const fresh = await fetchLiveStatusBatch(logins);
|
||||||
|
for (const [login, isLive] of fresh.entries()) {
|
||||||
|
const prev = liveStatusByLogin.get(login);
|
||||||
|
if (prev !== isLive) changes.push({ login, isLive });
|
||||||
|
liveStatusByLogin.set(login, isLive);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mainWindow && changes.length > 0) {
|
if (mainWindow && changes.length > 0) {
|
||||||
// Renderer only consumes `changes` — initial state comes via
|
// Renderer only consumes `changes` — initial state comes via
|
||||||
// the get-live-status-snapshot IPC at boot. Don't ship the
|
// the get-live-status-snapshot IPC at boot. Don't ship the
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user