From a18ab484cc4d883603def2f65737602810b1f013 Mon Sep 17 00:00:00 2001 From: Sucukdeluxe Date: Wed, 4 Mar 2026 02:50:16 +0100 Subject: [PATCH] Release v1.5.88 Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/main/constants.ts | 1 + src/main/download-manager.ts | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5dce1c6..55d1721 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.5.87", + "version": "1.5.88", "description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)", "main": "build/main/main/main.js", "author": "Sucukdeluxe", diff --git a/src/main/constants.ts b/src/main/constants.ts index b0c8860..e999515 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -19,6 +19,7 @@ export const CHUNK_SIZE = 512 * 1024; export const WRITE_BUFFER_SIZE = 512 * 1024; // 512 KB write buffer (JDownloader: 500 KB) export const WRITE_FLUSH_TIMEOUT_MS = 2000; // 2s flush timeout export const ALLOCATION_UNIT_SIZE = 4096; // 4 KB NTFS alignment +export const STREAM_HIGH_WATER_MARK = 2 * 1024 * 1024; // 2 MB stream buffer (JDownloader: Java NIO FileChannel default ~8 MB) export const SAMPLE_DIR_NAMES = new Set(["sample", "samples"]); export const SAMPLE_VIDEO_EXTENSIONS = new Set([".mkv", ".mp4", ".avi", ".mov", ".wmv", ".m4v", ".ts", ".m2ts", ".webm"]); diff --git a/src/main/download-manager.ts b/src/main/download-manager.ts index a507461..1e17d24 100644 --- a/src/main/download-manager.ts +++ b/src/main/download-manager.ts @@ -19,7 +19,7 @@ import { StartConflictResolutionResult, UiSnapshot } from "../shared/types"; -import { REQUEST_RETRIES, SAMPLE_VIDEO_EXTENSIONS, WRITE_BUFFER_SIZE, WRITE_FLUSH_TIMEOUT_MS, ALLOCATION_UNIT_SIZE } from "./constants"; +import { REQUEST_RETRIES, SAMPLE_VIDEO_EXTENSIONS, WRITE_BUFFER_SIZE, WRITE_FLUSH_TIMEOUT_MS, ALLOCATION_UNIT_SIZE, STREAM_HIGH_WATER_MARK } from "./constants"; import { cleanupCancelledPackageArtifactsAsync } from "./cleanup"; import { DebridService, MegaWebUnrestrictor, checkRapidgatorOnline } from "./debrid"; import { collectArchiveCleanupTargets, extractPackageArchives, findArchiveCandidates } from "./extractor"; @@ -4700,7 +4700,8 @@ export class DownloadManager extends EventEmitter { const stream = fs.createWriteStream(effectiveTargetPath, { flags: preAllocated ? "r+" : writeMode, - start: preAllocated ? 0 : undefined + start: preAllocated ? 0 : undefined, + highWaterMark: STREAM_HIGH_WATER_MARK }); let written = writeMode === "a" ? existingBytes : 0; let windowBytes = 0;