feat(qbittorrent): add api-key support (#5677)
This commit is contained in:
1 parent
7c64de5cbc
commit
756e8d1724
2 files changed
+11
-3
No files matched your search
@@ -61,7 +61,7 @@ export const integrationDefs = {
|
|||||||
},
|
},
|
||||||
qBittorrent: {
|
qBittorrent: {
|
||||||
name: "qBittorrent",
|
name: "qBittorrent",
|
||||||
secretKinds: [["username", "password"]],
|
secretKinds: [["apiKey"], ["username", "password"]],
|
||||||
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/qbittorrent.svg",
|
iconUrl: "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons@master/svg/qbittorrent.svg",
|
||||||
category: ["downloadClient", "torrent"],
|
category: ["downloadClient", "torrent"],
|
||||||
documentationUrl: createDocumentationLink("/docs/integrations/q-bittorent"),
|
documentationUrl: createDocumentationLink("/docs/integrations/q-bittorent"),
|
||||||
|
|||||||
@@ -90,10 +90,18 @@ export class QBitTorrentIntegration extends Integration implements IDownloadClie
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async getClientAsync(dispatcher?: Dispatcher) {
|
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({
|
return new QBittorrent({
|
||||||
|
...credentials,
|
||||||
baseUrl: this.url("/").toString(),
|
baseUrl: this.url("/").toString(),
|
||||||
username: this.getSecretValue("username"),
|
|
||||||
password: this.getSecretValue("password"),
|
|
||||||
dispatcher: dispatcher ?? (await createCertificateAgentAsync()),
|
dispatcher: dispatcher ?? (await createCertificateAgentAsync()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user