fix: add_paused changed to add_stopped in qbit 5 (#810)

This commit is contained in:
Björn Carlsson
2024-10-09 14:33:32 +02:00
committed by GitHub
parent 3337ab2828
commit 68b0dfab2c
3 changed files with 6 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ import {getDomainsFromURLs} from '../../util/torrentPropertiesUtil';
import ClientGatewayService from '../clientGatewayService';
import ClientRequestManager from './clientRequestManager';
import {QBittorrentTorrentContentPriority, QBittorrentTorrentTrackerStatus} from './types/QBittorrentTorrentsMethods';
import {isApiVersionAtLeast} from './util/apiVersionCheck';
import {
getTorrentPeerPropertiesFromFlags,
getTorrentStatusFromState,
@@ -88,7 +89,7 @@ class QBittorrentClientGatewayService extends ClientGatewayService {
.torrentsAddFiles(fileBuffers, {
savepath: destination,
tags: tags.join(','),
paused: !start,
[isApiVersionAtLeast(this.clientRequestManager.apiVersion, '2.11.0') ? 'stopped' : 'paused']: !start,
root_folder: !isBasePath,
contentLayout: isBasePath ? 'NoSubfolder' : undefined,
sequentialDownload: isSequential,
@@ -122,7 +123,7 @@ class QBittorrentClientGatewayService extends ClientGatewayService {
.torrentsAddURLs(urls, {
savepath: destination,
tags: tags.join(','),
paused: !start,
[isApiVersionAtLeast(this.clientRequestManager.apiVersion, '2.11.0') ? 'stopped' : 'paused']: !start,
root_folder: !isBasePath,
contentLayout: isBasePath ? 'NoSubfolder' : undefined,
sequentialDownload: isSequential,

View File

@@ -36,7 +36,7 @@ const EMPTY_SERVER_STATE = {
class ClientRequestManager {
private connectionSettings: QBittorrentConnectionSettings;
private apiBase: string;
private apiVersion: string | null = null;
apiVersion: string | null = null;
private authCookie: Promise<string | undefined> = Promise.resolve(undefined);
private isMainDataPending = false;

View File

@@ -123,6 +123,8 @@ export interface QBittorrentTorrentsAddOptions {
skip_checking?: boolean;
// Add torrents in the paused state. Possible values are true, false (default)
paused?: boolean;
// Add torrents in the stopped state (using webapiVersion v2.11.0 or later). Possible values are true, false (default)
stopped?: boolean;
// Create the root folder. Possible values are true, false, unset (default)
root_folder?: boolean;
// Content layout mode, replaces root_folder