-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
WebUI: Add "isPrivate" filter for 'info' API #20833
base: master
Are you sure you want to change the base?
WebUI: Add "isPrivate" filter for 'info' API #20833
Conversation
31955e6
to
37ee324
Compare
37ee324
to
44e71b0
Compare
@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 |
@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. |
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 ?) |
@@ -70,6 +70,7 @@ class TorrentFilter | |||
static const std::optional<QString> AnyCategory; | |||
static const std::optional<TorrentIDSet> AnyID; | |||
static const std::optional<Tag> AnyTag; | |||
static const std::optional<bool> AnyIsPrivate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name it AnyPrivate
.
@@ -34,6 +34,7 @@ | |||
const std::optional<QString> TorrentFilter::AnyCategory; | |||
const std::optional<TorrentIDSet> TorrentFilter::AnyID; | |||
const std::optional<Tag> TorrentFilter::AnyTag; | |||
const std::optional<bool> TorrentFilter::AnyIsPrivate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name it AnyPrivate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AnyPrivate
looks confusing.
Now since we use std::optional
these constants don't do much good. We can use std::nullopt
directly and not bother to come up with names for these constants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use std::nullopt directly and not bother to come up with names for these constants.
👍
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>
@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? |
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>
It looks weird to me.
I haven't got time to test. BTW our CI do provide build artifacts, you can use it to verify. |
👍 |
Thank you for the pointer, which helped me find the CI artefacts. In my regular setup, I run a docker container which I pull from lscr.io/linuxserver/qbittorrent:latest. If that's the case, I'm left off with my Mac to test (which runs on Sonoma). Lastly, after downloading them and unpacking the .zip, I see there is a .dmg inside and a cmake folder. The app inside the .dmg is crossed out in my case and when trying to open it I get a message "Not supported on this Mac". Appreciate your patience and help - happy to support testing.. Just need to figure out how to get the artefacts to run. |
mh. I changed the naming convention across the board, but now CI complains, since the word "private" is a reserved word in C++. Any suggestions what to do? Change to "privateFlag"? |
I couldn't imagine that you would misinterpret my comment above so much. I definitely didn't want you to change naming convention we use. I was just stating a fact about such a convention so that you could understand where the name of the method |
sorry. new to all of this.. let me revert the commit. Could you again please point me in the right direction in what sense I shall change the namings? Are we only talking about the matchIsPrivate and setIsPrivate functions to matchPrivate and setPrivate? |
7f51598
to
47c05fd
Compare
Yes, no docker image.
Different libtorrent versions and with GUI or not. Probably doesn't matter for you.
It seems our mac artifacts is for ARM. You're out of luck then... |
Many thanks for the guidance, @Chocobo1 . Besides not being 100% on the proposed renamings of the variables/functions (last post), I unfortunately do not know how to finish this PR without being able to test myself. Do you see any way that I can test (or would you know about someone who could support)? |
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