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

Initial support for Flood #5552

Merged
merged 2 commits into from
Jan 31, 2021
Merged

Initial support for Flood #5552

merged 2 commits into from
Jan 31, 2021

Conversation

jesec
Copy link
Contributor

@jesec jesec commented Dec 13, 2020

Database Migration

NO

Description

Add support for Flood, a modern Web UI for various torrent clients.

Closes #5793.

@austinwbest
Copy link
Contributor

So I guess I am confused. If it is essentially a wrapper UI around existing download clients & isn't a client, what is it you are trying to add?

@jesec
Copy link
Contributor Author

jesec commented Dec 13, 2020

So I guess I am confused. If it is essentially a wrapper UI around existing download clients & isn't a client, what is it you are trying to add?

Native support can deal with a lot of problems.

An example use case is that rTorrent XMLRPC interface is extremely insecure as it has the capabilities to execute any command. Flood, on the other side, has a modern, controlled, tested and audited API that avoids the security pitfalls.

Another use case is that the tags/categories implementation is different across clients. Flood only uses tags, and Radarr users are complaining that they can't see qBittorrent category Radarr added. jesec/flood#81

Additionally, one of the goal of the Flood project is to provide a common set of APIs across torrent clients. In the future, Flood will support more torrent clients, and Radarr may not currently support those clients. Native support also makes it easier for users to configure Radarr and Flood.

Radarr is an awesome project. I want to contribute to it and I believe this addition is useful.

@austinwbest
Copy link
Contributor

An example use case is that rTorrent XMLRPC interface is extremely insecure as it has the capabilities to execute any command. Flood, on the other side, has a modern, controlled, tested and audited API that avoids the security pitfalls.

Ok, so you are treating flood as the client, using its API and then it will communicate with the various clients? Middle man such as Jackett for download clients i guess :)

Another use case is that the tags/categories implementation is different across clients. Flood only uses tags, and Radarr users are complaining that they can't see qBittorrent category Radarr added. jesec/flood#81

Categories work fine with Radarr/QBT. Both setting the category on grab and updating it to what you want post-import so i am not real sure what that is about? Tags are informational (which tracker it came from, etc) in QBT so they are useless when it comes to handling of the files, etc. This sounds more like a Flood issue than something that would be fixed with this PR (or i am not following what you mean)

@jesec
Copy link
Contributor Author

jesec commented Dec 13, 2020

An example use case is that rTorrent XMLRPC interface is extremely insecure as it has the capabilities to execute any command. Flood, on the other side, has a modern, controlled, tested and audited API that avoids the security pitfalls.

Ok, so you are treating flood as the client, using its API and then it will communicate with the various clients? Middle man such as Jackett for download clients i guess :)

That is correct.

Another use case is that the tags/categories implementation is different across clients. Flood only uses tags, and Radarr users are complaining that they can't see qBittorrent category Radarr added. jesec/flood#81

Categories work fine with Radarr/QBT. Both setting the category on grab and updating it to what you want post-import so i am not real sure what that is about? Tags are informational (which tracker it came from, etc) in QBT so they are useless when it comes to handling of the files, etc. This sounds more like a Flood issue than something that would be fixed with this PR (or i am not following what you mean)

Tags are defined by users. Extra information (and the ability to filter torrents based on those information) can be very useful to users who have a large collection of torrents.

Additionally, tags can be more than just informational. In Flood, tags have a role in automatically deciding the download destination when destination is not provided.

With this PR, users can just use Flood's tagging system which ensures consistency across the board and fits their needs (without having to suffer the inconsistencies of qBittorrent's categories which Flood has no plan to support, plus qBittorrent is weighing to get rid of categories in favor of tags in PR 13773).

@jesec
Copy link
Contributor Author

jesec commented Dec 27, 2020

Ping @Qstick .

I would be appreciated if you can review this pull request. I deployed the PR on my instance, and it is working perfectly fine so far.

Thanks.

@Qstick
Copy link
Member

Qstick commented Jan 11, 2021

@jesec is this already updated with the changes requested that you did for Sonarr?

@jesec
Copy link
Contributor Author

jesec commented Jan 11, 2021

@jesec is this already updated with the changes requested that you did for Sonarr?

@Qstick

Not yet. I kinda prefer those features to stay if possible. "Sequential download" could prove to be more useful for larger (and non-time-sensitive) downloads like movies, which Radarr targets. I wrote about the benefits: jesec/flood#131. Meanwhile, "Target Ratio" is just an extra "if" condition, nothing else.

I would like to hear opinions of Radarr developers. Of course, I can also remove them if you would like to stick with Sonarr.

@jesec
Copy link
Contributor Author

jesec commented Jan 21, 2021

@Qstick The PR has been updated and rebased.

Copy link
Member

@Qstick Qstick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build failing due to commented variable.

In terms of Sequential and Ratio, I'd prefer to keep options tight to Sonarr.. It's a goal to eventually move extremely common areas (clients, notifications, etc) to be shared between the 4 programs... thus the less we have to deconflict them the better.

switch (additionalTag)
{
case (int)AdditionalTags.Collection:
result.Add(media.Movie.Collection.Name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

media doesn't exist, thus the build failures. I think you want remoteMovie?

@jesec jesec requested a review from Qstick January 25, 2021 08:33
@Qstick Qstick removed the Status: Waiting for OP Action Required from OP label Jan 25, 2021
[FieldDefinition(9, Label = "Additional Tags", Type = FieldType.Select, SelectOptions = typeof(AdditionalTags), HelpText = "Adds properties of media as tags. Hints are examples.", Advanced = true)]
public IEnumerable<int> AdditionalTags { get; set; }

[FieldDefinition(10, Label = "Start on Add", Type = FieldType.Checkbox)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other clients use a setting "Add Paused" defaulted to false (same basic functionality), can we switch this around to be consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flood's API uses start. Additionally, this is already in Sonarr. It is probably better to keep it as it is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Flood API doesn't need to change, logic in the proxy can handle that.

I assume Sonarr just missed it on review, but I'm sure they would take a PR to fix it up for consistency sake. I don't think it's a good idea to have it different than every other client in Radarr/Sonarr from a user perspective.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would require a database migration now to change this one.

Copy link
Contributor Author

@jesec jesec Jan 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise users will notice their settings to be unexpectedly flipped to the opposite site. I wouldn’t prefer that.

Plus, It is my belief that a good software design should use definitively affirmative (start on add) rather than unnecessary negative (add paused).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration on Sonarr will be a call for @markus101, but I'm sure he'd agree here on the call for consistency and be open to a quick migration for this if he deems it necessary. Regardless I'd like to see this changed for merge into Radarr.

I'm not asking you to change the default behavior, your 'StartOnAdd' defaulted to 'true' will turn into 'AddPaused' defaulted to 'false'. In either case they perform the same in the default setup. This is the expected format and behavior that both user bases currently expect and changing one client to be completely opposite adds unnecessary confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is implemented in 9b5672c. Note that I totally disagree with the change. Existing client implementation shows that the option is oriented to the APIs of respective clients. For instance, qBittorrent has InitialState instead while rTorrent/ruTorrent has nothing. All existing clients that uses AddPaused has a corresponding API interface that uses paused as well. This change makes the implementation contradictory to Flood's API.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, rTorrent has AddStopped, and yes Deluge/NzbGet/Vuze/Transmission all use AddPaused..

To your point I wouldn't be opposed centralizing them all to a InitialState field sometime in the future, as it seems a bit cleaner. If you want to go in with that on Flood I'm fine going that route, otherwise I'll merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may proceed. There is no such plan at the moment. Flood's isCompleted covers such case well, and it is much more concise than ForceStart initial state from API point of view. My disappointment with the divergence from Flood's APIs stands.

@jesec jesec requested a review from Qstick January 31, 2021 00:01
@Qstick Qstick merged commit 2237624 into Radarr:develop Jan 31, 2021
@Nosirus
Copy link

Nosirus commented Mar 8, 2021

Will there be the possibility to delete the torrent when the ratio is reached?

@bakerboy448
Copy link
Contributor

bakerboy448 commented Mar 8, 2021

@Nosirus this is already in radarr (as indicated on the merged status)

but no

Radarr is unable to remove torrents that have finished seeding when using Flood

Questions-> Reddit or Discord

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull Sonarr commit 'New: Flood Download Client'
5 participants