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

WebAPI: Add "private" filter for 'info' endpoint #20833

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

Conversation

ManiMatter
Copy link
Contributor

@ManiMatter ManiMatter commented May 13, 2024

It is already possible to filter the "info" response by hashes, status, tag, category.
Since the "isPrivate" flag has been added in #20686, it would be nice if it was possible to also pre-filter the response by this attribute.

I have - to the best of my abilities - implemented the code, but it is at the edge of my skills and I would appreciate your review.

The failed checks seem macOS related and affecting any PRs right now, thus not triggered by the changes I propose here

@thalieht thalieht added the WebAPI WebAPI-related issues/changes label May 13, 2024
@ManiMatter ManiMatter force-pushed the info-API-filter-by-isPrivate-flag branch 3 times, most recently from 31955e6 to 37ee324 Compare May 13, 2024 13:37
@ManiMatter ManiMatter force-pushed the info-API-filter-by-isPrivate-flag branch from 37ee324 to 44e71b0 Compare May 13, 2024 13:41
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/webui/api/serialize/serialize_torrent.h Outdated Show resolved Hide resolved
src/webui/api/torrentscontroller.cpp Outdated Show resolved Hide resolved
src/base/torrentfilter.cpp Outdated Show resolved Hide resolved
src/base/torrentfilter.cpp Outdated Show resolved Hide resolved
src/base/torrentfilter.cpp Outdated Show resolved Hide resolved
@glassez glassez requested review from a team May 16, 2024 13:19
@glassez glassez added this to the 5.0 milestone May 16, 2024
@ManiMatter ManiMatter requested a review from glassez May 16, 2024 16:50
@ManiMatter
Copy link
Contributor Author

@glassez Thanks having included this on milestone 5.0, and for having reviewed the code. I was not able to figure out how to test whether the feature works properly. Just wanted to check if you had a chance to test if it actually works?

Many thanks

@ManiMatter
Copy link
Contributor Author

@glassez - quick question, do I need to do anything here to get this merged?

@glassez
Copy link
Member

glassez commented Jun 6, 2024

@glassez - quick question, do I need to do anything here to get this merged?

At least it should be confirmed by someone from the team (or maybe by couple of other people) that it works as intended.

@ManiMatter
Copy link
Contributor Author

Thank you for the fast response. I unfortunately did not figure out how to build a docker image from the code so that I could test it myself.

Did you test it on your end by any chance? If so, did it work?

Looking forward for the other people to test it (guess that is done via qbittorrent/web-developers ?)

src/webui/api/serialize/serialize_torrent.h Outdated Show resolved Hide resolved
src/webui/api/serialize/serialize_torrent.cpp Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.cpp Outdated Show resolved Hide resolved
src/webui/api/torrentscontroller.cpp Outdated Show resolved Hide resolved
ManiMatter and others added 6 commits June 6, 2024 22:38
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
@ManiMatter
Copy link
Contributor Author

ManiMatter commented Jun 6, 2024

@Chocobo1 - many thanks for your review. I incorporated your changes.

Regarding renaming: I am not sure I understand your suggestion to rename the "isPrivate" to "private" in the various places. Since the flag that is returned currently in the properties is called "isPrivate", I feel it makes sense to keep calling it like this, rather than changing to "private". What was your thinking when suggesting the rename?

In terms of functionality, did the feature work for you as expected?

@ManiMatter
Copy link
Contributor Author

Thx for the commit, @glassez , much appreciated

@glassez

This comment was marked as off-topic.

@ManiMatter

This comment was marked as off-topic.

@glassez

This comment was marked as off-topic.

@ManiMatter

This comment was marked as off-topic.

@ManiMatter ManiMatter force-pushed the info-API-filter-by-isPrivate-flag branch from a2ae231 to 3eb56df Compare June 14, 2024 10:29
@ManiMatter

This comment was marked as off-topic.

src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/webui/api/serialize/serialize_torrent.h Show resolved Hide resolved
@ManiMatter ManiMatter force-pushed the info-API-filter-by-isPrivate-flag branch from 56f4790 to 69a2577 Compare June 14, 2024 11:35
Chocobo1
Chocobo1 previously approved these changes Jun 14, 2024
@Chocobo1
Copy link
Member

@ManiMatter
From #20833 (comment)

Regardless, you should increment API_VERSION in webapplication.h due to other changes.

@ManiMatter
Copy link
Contributor Author

@ManiMatter From #20833 (comment)

Regardless, you should increment API_VERSION in webapplication.h due to other changes.

done

Chocobo1
Chocobo1 previously approved these changes Jun 14, 2024
src/webui/webapplication.h Outdated Show resolved Hide resolved
Chocobo1
Chocobo1 previously approved these changes Jun 14, 2024
@glassez glassez changed the title WebUI: Add "isPrivate" filter for 'info' API WebUI: Add "private" filter for 'info' endpoint Jun 14, 2024
@glassez glassez changed the title WebUI: Add "private" filter for 'info' endpoint WebAPI: Add "private" filter for 'info' endpoint Jun 14, 2024
src/base/torrentfilter.h Outdated Show resolved Hide resolved
src/base/torrentfilter.h Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebAPI WebAPI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants