Serial/parallel transfers setting
Transfers: Single | Multi in the options popover, with an 'At once' picker (2/3/4/6/8) when Multi. Engine concurrency becomes an instance field applied live: at boot from settings.json and on every saveSettings (raising the limit starts queued jobs immediately). Verified headless: 3 slow jobs overlap at concurrency 3, stay strictly serial at 1, clamp works. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,14 +46,25 @@ export interface AppSettings {
|
||||
speedUnit: "MBps" | "Mbps";
|
||||
/** Font size of the path bar and file list. */
|
||||
textSize: "compact" | "default" | "large";
|
||||
/** Run transfer jobs one at a time, or several in parallel. */
|
||||
transferMode: "single" | "multi";
|
||||
/** How many jobs run at once when transferMode is "multi". */
|
||||
transferConcurrency: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: AppSettings = {
|
||||
theme: "system",
|
||||
speedUnit: "MBps",
|
||||
textSize: "default",
|
||||
transferMode: "single",
|
||||
transferConcurrency: 3,
|
||||
};
|
||||
|
||||
export function effectiveConcurrency(settings: AppSettings): number {
|
||||
if (settings.transferMode === "single") return 1;
|
||||
return Math.max(1, Math.min(8, Math.round(settings.transferConcurrency) || 1));
|
||||
}
|
||||
|
||||
export type TransferState =
|
||||
| "queued"
|
||||
| "scanning"
|
||||
|
||||
Reference in New Issue
Block a user