mirror of
https://github.com/Andre-Bzk/twitch4steamdeck.git
synced 2026-11-15 15:43:08 +01:00
feat: add HLS cache toggle and cache management to Settings
Chromium's HTTP disk cache accumulates HLS segments indefinitely on Steam Deck — single-use segments have ~0% cache-hit rate but cause unbounded SSD writes and disk growth. This wires up a runtime toggle (default: cache disabled) so the user can control the behaviour without restarting the app. - Introduce src/main/prefs/hlsCachePref.ts as a shared mutable so index.ts and handlers.ts don't form a circular import - Restructure onHeadersReceived in setupTwitchCors: CORS-bypass and no-store now run as independent blocks; no-store fires only for HLS extensions (.m3u8/.ts/.m4s/.aac, path before ?) when the toggle is off - Add IPC handlers app:get-cache-size, app:clear-cache, app:set-hls-cache-enabled; wire through preload bridge and t4sd.d.ts - Extend SettingsContext with hlsCacheEnabled (default false); push persisted value to main on mount and on every change - Add "Speicher" section to SettingsScreen with HLS toggle row and cache-size display + clear button; gamepad-navigable
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
let hlsCacheEnabled = false
|
||||
|
||||
export function getHlsCacheEnabled(): boolean {
|
||||
return hlsCacheEnabled
|
||||
}
|
||||
|
||||
export function setHlsCacheEnabled(enabled: boolean): void {
|
||||
hlsCacheEnabled = enabled
|
||||
}
|
||||
Reference in New Issue
Block a user