From 57f56d98a69fb1955f3d4fbfbcc4f5c45411c554 Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Tue, 19 May 2026 13:59:04 +0200 Subject: [PATCH] =?UTF-8?q?release:=205.0.10=20=E2=80=94=20Single-Source-O?= =?UTF-8?q?f-Truth=20fuer=20Config-Defaults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DEFAULT_METADATA_CACHE_MINUTES und DEFAULT_PERFORMANCE_MODE waren dupliziert in main.ts und src/main/domain/config-normalize.ts. Wenn jemand einen Default aendert (z.B. metadata-cache von 10 auf 15min), ist die andere Seite still drift-anfaellig — config laedt den alten Default beim Erst-Start aber normalize-Funktion fallt auf den neuen zurueck. Fix: beide Konstanten werden jetzt aus config-normalize.ts exportiert und in main.ts importiert. Single source of truth. Co-Authored-By: Claude Opus 4.7 (1M context) --- package-lock.json | 4 ++-- package.json | 2 +- src/main.ts | 7 +++++-- src/main/domain/config-normalize.ts | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index c68c41a..06742db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "twitch-vod-manager", - "version": "5.0.9", + "version": "5.0.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "twitch-vod-manager", - "version": "5.0.9", + "version": "5.0.10", "license": "MIT", "dependencies": { "axios": "^1.16.1", diff --git a/package.json b/package.json index c340e05..b15eb3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "twitch-vod-manager", - "version": "5.0.9", + "version": "5.0.10", "description": "Twitch VOD Manager - Download Twitch VODs easily", "main": "dist/main.js", "author": "xRangerDE", diff --git a/src/main.ts b/src/main.ts index 019d2c8..c050cd1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,6 +26,8 @@ import { normalizePerformanceMode, isPlainObject, VALID_STREAMLINK_QUALITIES, + DEFAULT_METADATA_CACHE_MINUTES, + DEFAULT_PERFORMANCE_MODE, type PerformanceMode, } from './main/domain/config-normalize'; import { CustomClip, MergeGroupItem, MergeGroup, QueueItem, DownloadProgress, DownloadResult } from './types'; @@ -62,8 +64,9 @@ const DEFAULT_DOWNLOAD_PATH = path.join(app.getPath('desktop'), 'Twitch_VODs'); const DEFAULT_FILENAME_TEMPLATE_VOD = '{title}.mp4'; const DEFAULT_FILENAME_TEMPLATE_PARTS = '{date}_Part{part_padded}.mp4'; const DEFAULT_FILENAME_TEMPLATE_CLIP = '{date}_{part}.mp4'; -const DEFAULT_METADATA_CACHE_MINUTES = 10; -const DEFAULT_PERFORMANCE_MODE: PerformanceMode = 'balanced'; +// DEFAULT_METADATA_CACHE_MINUTES + DEFAULT_PERFORMANCE_MODE kommen aus +// ./main/domain/config-normalize (Single-Source-Of-Truth, vermeidet +// Drift wenn man eine der Defaults aendert). const QUEUE_SAVE_DEBOUNCE_MS = 250; const MIN_FREE_DISK_BYTES = 128 * 1024 * 1024; const DEBUG_LOG_FLUSH_INTERVAL_MS = 1000; diff --git a/src/main/domain/config-normalize.ts b/src/main/domain/config-normalize.ts index df5f9e1..e660759 100644 --- a/src/main/domain/config-normalize.ts +++ b/src/main/domain/config-normalize.ts @@ -6,8 +6,8 @@ export const VALID_STREAMLINK_QUALITIES = ['best', 'source', '1080p60', '720p60' const AUTO_RECORD_POLL_MIN_SECONDS = 30; const AUTO_RECORD_POLL_MAX_SECONDS = 1800; -const DEFAULT_METADATA_CACHE_MINUTES = 10; -const DEFAULT_PERFORMANCE_MODE: PerformanceMode = 'balanced'; +export const DEFAULT_METADATA_CACHE_MINUTES = 10; +export const DEFAULT_PERFORMANCE_MODE: PerformanceMode = 'balanced'; /** trim + strip leading @ + lowercase. Verbatim aus altem main.ts. */ export function normalizeLogin(input: string): string {