Skip to content

WebUI: Add new Add Torrent experience #21645

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Piccirello
Copy link
Member

@Piccirello Piccirello commented Oct 19, 2024

This PR uses the new APIs from #21015 to provide a WebUI Add Torrent experience more closely matching the GUI's.

New functionality:

  • View torrent size, date, infohash, files, etc.
  • Reprioritize and ignore files before adding
  • Specify tags when adding torrent
  • Specify save path for incomplete torrent

Closes #20557, closes #10997, closes #12499, closes #14201, closes #15071, closes #15718, closes #16207.

after

Mobile:

IMG_9562

More screenshots

Before:
before

GUI, for comparison:
gui

@Piccirello Piccirello added the WebUI WebUI-related issues/changes label Oct 19, 2024
@Piccirello Piccirello added this to the 5.1 milestone Oct 19, 2024
@Piccirello Piccirello force-pushed the metadata-webui branch 5 times, most recently from 9317683 to 815976c Compare November 3, 2024 21:58
@zhen-huan-hu

This comment was marked as off-topic.

@stauffenberg2020

This comment was marked as off-topic.

@glassez glassez removed this from the 5.1 milestone Apr 15, 2025
@Piccirello Piccirello force-pushed the metadata-webui branch 7 times, most recently from 7a77673 to 37ce1c4 Compare June 9, 2025 20:50
@glassez glassez changed the title Add new Add Torrent experience to WebUI WebUI: Add new Add Torrent experience Jun 17, 2025
@Piccirello Piccirello marked this pull request as ready for review June 17, 2025 17:00
@Piccirello Piccirello requested a review from a team June 17, 2025 17:01
@glassez
Copy link
Member

glassez commented Jun 17, 2025

I would prefer all independent commits to be extracted into separate PRs.

@thalieht
Copy link
Contributor

Can you double check if you have "Keep incomplete torrents in" checked in qBittorrent options? I think what is happening is that the Add Torrent window isn't yet reflecting this preference. I'll push up a fix.

That's what i've been saying. Indeed it didn't reflect this preference but the problem is still not resolved.
When unchecking this setting in Add Torrent window, "Keep incomplete torrents in" in qBittorrent options is still used i.e. the torrent starts to download to the incomplete path... I don't know how to explain it better, i hope someone else can do a better job at explaining it.

A couple more issues i found that may not be relevant:

  1. Maybe it's just me: The initial height of this window is bigger than what fits in my browser. The important part is that it "thinks" that it fits (Add torrent button not visible) and there is no scrollbar until i reduce the height.
  2. I don't know if there is API to get a category's "incomplete save path" (because it's not editable from the filters sidebar) but: When using Automatic TMM, in GUI, the "Use another path for incomplete torrents" checkbox and its field reflect the category's Incomplete Save Path. Here in WebUI it's always unchecked and its field is empty.

@Piccirello
Copy link
Member Author

Can you double check if you have "Keep incomplete torrents in" checked in qBittorrent options? I think what is happening is that the Add Torrent window isn't yet reflecting this preference. I'll push up a fix.

That's what i've been saying. Indeed it didn't reflect this preference but the problem is still not resolved. When unchecking this setting in Add Torrent window, "Keep incomplete torrents in" in qBittorrent options is still used i.e. the torrent starts to download to the incomplete path... I don't know how to explain it better, i hope someone else can do a better job at explaining it.

Sorry, I misunderstood you. And I think I understand what you're saying now. If the "Keep incomplete torrents in" setting is checked in qBittorrent's options then it's always used, regardless of whether it's checked in the Add Torrent window. Thanks for remaining persistent until I understood - I'll work on a fix for this.

A couple more issues i found that may not be relevant:

  1. Maybe it's just me: The initial height of this window is bigger than what fits in my browser. The important part is that it "thinks" that it fits (Add torrent button not visible) and there is no scrollbar until i reduce the height.

#22919 should make this a non-issue.

  1. I don't know if there is API to get a category's "incomplete save path" (because it's not editable from the filters sidebar) but: When using Automatic TMM, in GUI, the "Use another path for incomplete torrents" checkbox and its field reflect the category's Incomplete Save Path. Here in WebUI it's always unchecked and its field is empty.

I see what you mean. As you noted, we don't have access to the category's incomplete save path in the WebAPI. I'm not going to tackle that yet, as I don't think it's essential, but a separate PR could definitely enhance this.

@Piccirello
Copy link
Member Author

Piccirello commented Jun 26, 2025

Can you double check if you have "Keep incomplete torrents in" checked in qBittorrent options? I think what is happening is that the Add Torrent window isn't yet reflecting this preference. I'll push up a fix.

That's what i've been saying. Indeed it didn't reflect this preference but the problem is still not resolved. When unchecking this setting in Add Torrent window, "Keep incomplete torrents in" in qBittorrent options is still used i.e. the torrent starts to download to the incomplete path... I don't know how to explain it better, i hope someone else can do a better job at explaining it.

Sorry, I misunderstood you. And I think I understand what you're saying now. If the "Keep incomplete torrents in" setting is checked in qBittorrent's options then it's always used, regardless of whether it's checked in the Add Torrent window. Thanks for remaining persistent until I understood - I'll work on a fix for this.

This should now be fixed.

  1. I don't know if there is API to get a category's "incomplete save path" (because it's not editable from the filters sidebar) but: When using Automatic TMM, in GUI, the "Use another path for incomplete torrents" checkbox and its field reflect the category's Incomplete Save Path. Here in WebUI it's always unchecked and its field is empty.

I see what you mean. As you noted, we don't have access to the category's incomplete save path in the WebAPI. I'm not going to tackle that yet, as I don't think it's essential, but a separate PR could definitely enhance this.

It looks like we actually do have access to the incomplete save path via the download_path property in the torrents/categories response. There's just no way yet to set a category's incomplete save path from the WebUI. I've added support for using the category's incomplete save path, including when a category's "Use another path for incomplete torrents" option is set to No. Give it a try! You'll obviously need to set the category's incomplete save path from the GUI, but it should be respected in the WebUI. And when support for setting it from the WebUI is finally added, it should just work with the WebUI's Add Torrent dialog.

@thalieht
Copy link
Contributor

This should now be fixed.

👍

A few more issues concerning "Keep incomplete torrents in" checkbox and its field:

When "Keep incomplete torrents in" in qBittorrent options is checked (the global setting as i like to call it):
In this window:

  1. In Manual TMM, "Keep incomplete torrents in" checkbox is not initialized as checked (it should be, also when changing from Automatic to Manual, since the global setting is also checked)
  2. In Automatic TMM, select a category with an explicitly disabled incomplete save path and then select the "Empty" category. "Keep incomplete torrents in" checkbox should become enabled (just cosmetic)

When "Keep incomplete torrents in" in qBittorrent options is unchecked:
In this window:

  1. In Automatic TMM, "Keep incomplete torrents in" checkbox is always unchecked (just cosmetic). It should be enabled when a category has an explicitly enabled incomplete save path.

General issue in this window:
When "Keep incomplete torrents in" checkbox is unchecked, its field should be empty.

@Piccirello
Copy link
Member Author

You're doing an awesome job finding these edge cases. All this state is a real pain to manage.

  1. In Manual TMM, "Keep incomplete torrents in" checkbox is not initialized as checked (it should be, also when changing from Automatic to Manual, since the global setting is also checked)

I intentionally didn't add this, since the TMM is set to manual, but I think it's a fair argument that it should. And I see that the GUI does this. Fixed.

  1. In Automatic TMM, select a category with an explicitly disabled incomplete save path and then select the "Empty" category. "Keep incomplete torrents in" checkbox should become enabled (just cosmetic)

I thought I had tested every iteration here but great find. Fixed.

When "Keep incomplete torrents in" in qBittorrent options is unchecked: In this window:

  1. In Automatic TMM, "Keep incomplete torrents in" checkbox is always unchecked (just cosmetic). It should be enabled when a category has an explicitly enabled incomplete save path.

Fixed.

General issue in this window: When "Keep incomplete torrents in" checkbox is unchecked, its field should be empty.

Fixed.

@Piccirello
Copy link
Member Author

Temporarily putting this PR back into draft as it relies on some changes in #22938. The changes remove the need for the Add Torrent window to fetch categories and tags. Instead, it can now access them directly via the parent window.

@Piccirello Piccirello marked this pull request as draft June 28, 2025 06:39
@Piccirello Piccirello force-pushed the metadata-webui branch 2 times, most recently from cd02df8 to 7d2df90 Compare July 11, 2025 21:15
This logic was tightly coupled with the prop-files table.

Signed-off-by: Thomas Piccirello <thomas@piccirello.com>
This dialog more closely mimics the dialog presented by the GUI. It includes information about the contents of a torrent.

Signed-off-by: Thomas Piccirello <thomas@piccirello.com>
This is done in a separate commit to avoid losing revision history.
Signed-off-by: Thomas Piccirello <thomas@piccirello.com>
Signed-off-by: Thomas Piccirello <thomas@piccirello.com>
@Piccirello Piccirello marked this pull request as ready for review July 15, 2025 03:04
@Piccirello
Copy link
Member Author

#22938 has been merged and so I have taken this out of draft.

@Piccirello Piccirello requested a review from glassez July 15, 2025 03:05
@Ryu481
Copy link
Contributor

Ryu481 commented Jul 15, 2025

Would it be possible to add the Remember last used save path option? This is available in the GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebUI WebUI-related issues/changes
Projects
None yet
8 participants