Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

feat(qbittorrent): add api-key support (#5677)

Meier Lukas756e8d172455
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()),
});
}