Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add_paused changed to add_stopped in qbit 5 #810

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
whiteout12 marked this conversation as resolved.
Show resolved Hide resolved
// Create the root folder. Possible values are true, false, unset (default)
root_folder?: boolean;
// Content layout mode, replaces root_folder
Expand Down
Loading