Compare commits
No commits in common. "7e60d0e920b2c31ff567aca3ac6a74532988ac5f" and "96683afa14e5b6fe285b88623bfb8320ac365635" have entirely different histories.
7e60d0e920
...
96683afa14
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.60",
|
"version": "4.6.59",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "twitch-vod-manager",
|
"name": "twitch-vod-manager",
|
||||||
"version": "4.6.60",
|
"version": "4.6.59",
|
||||||
"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.60",
|
"version": "4.6.59",
|
||||||
"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",
|
||||||
|
|||||||
@ -21,20 +21,6 @@ let pendingHoverVodId: string | null = null;
|
|||||||
const HOVER_DEBOUNCE_MS = 220;
|
const HOVER_DEBOUNCE_MS = 220;
|
||||||
const FRAME_INTERVAL_MS = 600;
|
const FRAME_INTERVAL_MS = 600;
|
||||||
const FRAMES_TO_CYCLE = 4;
|
const FRAMES_TO_CYCLE = 4;
|
||||||
// Bounded cache — each storyboard data URL is ~50-200 KB, so an
|
|
||||||
// unbounded cache could balloon to hundreds of MB on a long browsing
|
|
||||||
// session through a streamer with thousands of VODs. FIFO eviction
|
|
||||||
// keeps the working set fresh without manual cleanup.
|
|
||||||
const MAX_CLIENT_STORYBOARD_CACHE = 100;
|
|
||||||
|
|
||||||
function rememberStoryboard(vodId: string, sb: VodStoryboard | null): void {
|
|
||||||
vodStoryboardClientCache.set(vodId, sb);
|
|
||||||
if (vodStoryboardClientCache.size > MAX_CLIENT_STORYBOARD_CACHE) {
|
|
||||||
// Map iterator is insertion-ordered — first key is the oldest.
|
|
||||||
const oldestKey = vodStoryboardClientCache.keys().next().value as string | undefined;
|
|
||||||
if (oldestKey !== undefined) vodStoryboardClientCache.delete(oldestKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function ensureVodHoverHandlersBound(): void {
|
function ensureVodHoverHandlersBound(): void {
|
||||||
const grid = document.getElementById('vodGrid');
|
const grid = document.getElementById('vodGrid');
|
||||||
@ -99,7 +85,7 @@ async function activateHoverPreview(card: HTMLElement, vodId: string): Promise<v
|
|||||||
} catch (_) {
|
} catch (_) {
|
||||||
storyboard = null;
|
storyboard = null;
|
||||||
}
|
}
|
||||||
rememberStoryboard(vodId, storyboard);
|
vodStoryboardClientCache.set(vodId, storyboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cursor may have moved on while we awaited; re-check guard.
|
// Cursor may have moved on while we awaited; re-check guard.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user