From 756e8d172455f91e40cd8fb5faff6953cc9778c5 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Fri, 8 May 2026 20:08:37 +0200 Subject: [PATCH] feat(qbittorrent): add api-key support (#5677) --- packages/definitions/src/integration.ts | 2 +- .../qbittorrent/qbittorrent-integration.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/definitions/src/integration.ts b/packages/definitions/src/integration.ts index 81c58b0af..dfc862fbb 100644 --- a/packages/definitions/src/integration.ts +++ b/packages/definitions/src/integration.ts @@ -61,7 +61,7 @@ export const integrationDefs = { }, qBittorrent: { name: "qBittorrent", - secretKinds: [["username", "password"]], + secretKinds: [["apiKey"], ["username", "password"]], iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/qbittorrent.svg", category: ["downloadClient", "torrent"], documentationUrl: createDocumentationLink("/docs/integrations/q-bittorent"), diff --git a/packages/integrations/src/download-client/qbittorrent/qbittorrent-integration.ts b/packages/integrations/src/download-client/qbittorrent/qbittorrent-integration.ts index 1076bca5e..a142fb1a3 100644 --- a/packages/integrations/src/download-client/qbittorrent/qbittorrent-integration.ts +++ b/packages/integrations/src/download-client/qbittorrent/qbittorrent-integration.ts @@ -90,10 +90,18 @@ export class QBitTorrentIntegration extends Integration implements IDownloadClie } private async getClientAsync(dispatcher?: Dispatcher) { + const credentials = this.hasSecretValue("apiKey") + ? { + apiKey: this.getSecretValue("apiKey"), + } + : { + username: this.getSecretValue("username"), + password: this.getSecretValue("password"), + }; + return new QBittorrent({ + ...credentials, baseUrl: this.url("/").toString(), - username: this.getSecretValue("username"), - password: this.getSecretValue("password"), dispatcher: dispatcher ?? (await createCertificateAgentAsync()), }); }