Skip to content

Commit

Permalink
fix: add_paused changed to add_stopped in qbit 5 (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteout12 authored Oct 9, 2024
1 parent 3337ab2 commit 68b0dfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions server/services/qBittorrent/clientGatewayService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion server/services/qBittorrent/clientRequestManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 68b0dfa

Please sign in to comment.