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