Raise proxy connection limit to 40
This commit is contained in:
@@ -5,7 +5,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { Transform } from "node:stream";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { downloadWithProxySegments, parseProxyList, selectFixedProxy } from "../src/main/proxy-segmented-download";
|
||||
import { downloadWithProxySegments, normalizeProxyConnectionLimit, parseProxyList, selectFixedProxy } from "../src/main/proxy-segmented-download";
|
||||
|
||||
interface RunningServer {
|
||||
port: number;
|
||||
@@ -128,6 +128,13 @@ async function createTempDirectory(): Promise<string> {
|
||||
}
|
||||
|
||||
describe("proxy segmented download", () => {
|
||||
it("uses 32 connections by default and clamps the configurable maximum to 40", () => {
|
||||
expect(normalizeProxyConnectionLimit(0)).toBe(32);
|
||||
expect(normalizeProxyConnectionLimit(40)).toBe(40);
|
||||
expect(normalizeProxyConnectionLimit(999)).toBe(40);
|
||||
expect(normalizeProxyConnectionLimit(1)).toBe(2);
|
||||
});
|
||||
|
||||
it("accepts authenticated premium proxy list formats without exposing entries", () => {
|
||||
const secret = "private-password";
|
||||
const count = parseProxyList([
|
||||
|
||||
@@ -683,7 +683,7 @@ describe("settings views", () => {
|
||||
label: "Proxy-Verbindungen insgesamt",
|
||||
value: "16",
|
||||
min: 2,
|
||||
max: 32,
|
||||
max: 40,
|
||||
help: expect.stringContaining("zusammen höchstens 16 Segmentverbindungen")
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -606,15 +606,15 @@ describe("settings storage", () => {
|
||||
expect(normalized.proxyDownloadEnabled).toBe(true);
|
||||
expect(normalized.proxyListPath).toBe("C:\\proxies.txt");
|
||||
expect(normalized.proxyApiProxyIndex).toBe(100000);
|
||||
expect(normalized.proxyConnectionsPerDownload).toBe(32);
|
||||
expect(normalized.proxyConnectionsPerDownload).toBe(40);
|
||||
expect(normalized.outputDir).toBe(defaultSettings().outputDir);
|
||||
expect(normalized.extractDir).toBe(defaultSettings().extractDir);
|
||||
expect(normalized.mkvLibraryDir).toBe(defaultSettings().mkvLibraryDir);
|
||||
expect(normalized.updateRepo).toBe(defaultSettings().updateRepo);
|
||||
});
|
||||
|
||||
it("uses 20 total proxy connections as the default for new settings", () => {
|
||||
expect(defaultSettings().proxyConnectionsPerDownload).toBe(20);
|
||||
it("uses 32 total proxy connections as the default for new settings", () => {
|
||||
expect(defaultSettings().proxyConnectionsPerDownload).toBe(32);
|
||||
});
|
||||
|
||||
it("migrates the previous private update repository to the public release repository", () => {
|
||||
|
||||
@@ -120,7 +120,7 @@ function createSettings(): AppSettings {
|
||||
proxyDownloadEnabled: false,
|
||||
proxyListPath: "",
|
||||
proxyApiProxyIndex: 1,
|
||||
proxyConnectionsPerDownload: 20,
|
||||
proxyConnectionsPerDownload: 32,
|
||||
updateRepo: "Sucukdeluxe/Multi-Debrid-Downloader",
|
||||
autoUpdateCheck: true,
|
||||
clipboardWatch: true,
|
||||
|
||||
Reference in New Issue
Block a user