mirror of
https://github.com/zoriya/flood.git
synced 2025-12-05 23:06:20 +00:00
fix: add_paused changed to add_stopped in qbit 5 (#810)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user