Fix: Standardize Electron bridge and implement robust caching

- Refactored all IPC methods and parameters to snake_case for consistency with SvelteKit.
- Implemented exhaustive background caching engine with download locking.
- Reverted to legacy-proven flat hash storage pattern (hash.file).
- Added axios for reliable stream-based binary downloads.
- Updated preload and main handlers to support recursive room data fetching.
This commit is contained in:
Scott Idem
2026-01-23 16:30:23 -05:00
parent 30db989b2c
commit 280de213c1
21 changed files with 665 additions and 24 deletions

16
src/main/file_utils.ts Normal file
View File

@@ -0,0 +1,16 @@
import * as os from 'os';
import * as path from 'path';
export function expandPath(filePath: string): string {
if (!filePath) return filePath;
if (filePath.startsWith('[home]')) {
return path.join(os.homedir(), filePath.replace('[home]', ''));
}
return filePath;
}
export function getHashedPath(cacheRoot: string, hash: string): string {
const expandedRoot = expandPath(cacheRoot);
const subdirectory = hash.substring(0, 2);
return path.join(expandedRoot, subdirectory, `${hash}.file`);
}