Skip to content

WebAPI: /add: paused doesn't do anything. #22766

@Lyrcaxis

Description

@Lyrcaxis

qBittorrent & operating system versions

qBittorrent: 5.1.0 x64
Operating system: N/A (API access)
Qt: N/A

What is the problem?

The paused property on the form doesn't seem to be doing anything.

When "Do not start the download automatically" is "UNCHECKED":

  • Adding paused="true" doesn't ensure paused starting state

When "Do not start the download automatically" is "CHECKED":

  • Adding paused="false" doesn't automatically start the download

Even with autoTMM="false".

Steps to reproduce

Well, here's a minimal repro C# code in case it matters:

// WELL, use your URL/username/password
const string baseURL = "http://localhost:PORT";
const string username = "username";
const string password = "password";

public static async Task<bool> AddTorrentFromFileAsync(string torrentFilePath, bool startPaused = true) {
    using var client = new HttpClient(handler) { BaseAddress = new Uri(baseURL) };
    var authContent = new FormUrlEncodedContent([new("username", username), new("password", password)]);
    await client.PostAsync("/api/v2/auth/login", authContent);

    using var form = new MultipartFormDataContent();
    using var fileContent = new ByteArrayContent(await File.ReadAllBytesAsync(torrentFilePath));
    form.Add(content: fileContent, name: "torrents", fileName: Path.GetFileName(torrentFilePath));

    if (startPaused) { form.Add(content: new StringContent("true"), name: "paused"); }
    //form.Add(new StringContent("false"), "autoTMM"); // optionally.

    await client.PostAsync("/api/v2/torrents/add", form);
}

Additional context

No response

Log(s) & preferences file(s)

N/A -- various preference combos I've checked affect nothing related to pause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions