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

Expose stop_when_ready flag #17250

Closed
wants to merge 1 commit into from

Conversation

Dobatymo
Copy link

This PR allows to set torrent_flags_t.stop_when_ready flag using addTorrentParams in addTorrent and expose in webapi.

…Params` in `addTorrent` and expose in webapi
@glassez
Copy link
Member

glassez commented Jun 21, 2022

Currently this flag is used by qBittorrent internally to perform some service jobs. By directly exposing it to user space you most likely break it. I am not sure that it is required in the user space in its low-level sense. So first of all it would be nice to find out what it should have been intended for by you.

@Dobatymo
Copy link
Author

Dobatymo commented Jun 21, 2022

@glassez Yes sorry I should have mentioned that. I am creating python helper scripts to control qBittorrent via the webapi. One of the things I do is scan the harddrive for files which match a torrent file and add to the client. In most cases they are added and checked fine to 100%. But sometimes the hash doesn't fully match (paths and sizes do) and the original files are destroyed because qbittorrent overwrites these parts. If I add them paused, it wouldn't recheck them to see if the match. So I would like to use the stop_when_ready flag to add them so the download doesn't start in the case the files don't fully match.

I saw the flag is used by qBittorrent during rechecking. I don't think adding it to the add torrent operation can break anything.

@glassez
Copy link
Member

glassez commented Jun 21, 2022

If I add them paused, it wouldn't recheck them to see if the match.

Yes, this is a known problem for me. Unfortunately, we have conflicting opinions from users, so some prefer that torrents added as "stopped" really do nothing, while others want the hash check to be done anyway.
In any case, I'm still sure that this flag is too low-level to provide it directly. In addition, it seems that user preferences have a permanent meaning. So I intended to just add some global option "Always check the hashes of added torrents".

@Dobatymo
Copy link
Author

I am fine with the current behaviour of the web interface or the GUI. But I think by exposing this flag in the webapi, it will only ever be used by advanced users anyway.

@Dobatymo Dobatymo marked this pull request as ready for review July 14, 2022 01:23
@github-actions
Copy link

This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity.

@github-actions github-actions bot added the Stale label Sep 13, 2022
@Dobatymo
Copy link
Author

Any comments?
Like I said above, it would only be added to the WebAPI ie. for advanced users. It doesn't change any existing functionality in any way.

@github-actions github-actions bot removed the Stale label Sep 14, 2022
@glassez
Copy link
Member

glassez commented Oct 2, 2022

@Dobatymo
#17814 should satisfy your needs as well.

@Dobatymo
Copy link
Author

Dobatymo commented Oct 2, 2022

@glassez From what I can understand from your PR, you don't use the stop_when_ready flag but instead pause when the respective alert is raised, right? I am not sure why you try to avoid the usage of this flag, but if it basically does the same, I am fine with it and it should indeed solve my issue! Thank you! I will close the issue, when the PR is merged.

@glassez
Copy link
Member

glassez commented Oct 2, 2022

From what I can understand from your PR, you don't use the stop_when_ready flag but instead pause when the respective alert is raised, right?

Well, if don't go into details, yes.

I am not sure why you try to avoid the usage of this flag,

It behaves inconvenient, IMO. I need torrent to be stopped after files is checked independently from the way it is added (.torrent file or magnet link).

if it basically does the same, I am fine with it and it should indeed solve my issue!

Well, if you really need the result and not the implementation details, then it should satisfy you (unless you need exactly the same behavior as stop_when_ready flag).

@glassez
Copy link
Member

glassez commented Oct 9, 2022

Superseded by #17814.

@glassez glassez closed this Oct 9, 2022
@Dobatymo Dobatymo deleted the webapi-stop_when_ready branch January 31, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants