-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Add a temporary name filter to the current view of the main view window. #519
Conversation
By using 'F' in the main view you can enter a regex that will be used to filter the view based on the torrent name. To remove the filter set the input to empty. This is adding a 'view.temp_filter' property and a 'match{}' function. For example with Ctrl+X you could do: command> view.temp_filter=main,"match={d.name=,.*linux.*iso}"
Woow! It's a long awaited feature if it will be merged. Thank you! A couple of notes though if you don't mind.
Advantages:
|
Oops, my description is ambiguous. |
Woow, indeed! Sorry for my previous comment, just ignore it, I haven't played with it at that time. Now I did.
Small modifications:
The modified patch: Thank You! |
I just noticed 1 more thing: if a view is sorted (just once, not by a E.g. suppose the I think the solution can be that here we call Edit:
|
- Suffix filtered view name with "(filtered)" - Add a check to not filter "start" and "stopped" view
I've merged your changes. |
Even better! Thanks 1 more suggestion popped in my mind: So let's create a config directive for it that should be disabled by default, name can be something like: |
Just a note to those who use @pyroscope's |
Adding a |
Looking at some uses of multicall and the main view, I think the current solution is a bad idea (see the scraping code by @chros73 that relies on iterating all items, and other multicall uses). Filters should apply to the UI view only (i.e. keep / update a separate filtered list, so treat the filter result as a cache of the main list of a view), and a
This would also remove the need to special-handle started and stopped (which is a sign of the breakage). |
You're right. This alone renders multi-view solution into a single-view solution (like yours was but this one way faster): hence I only use it with |
While looking at While I stand behind #519 (comment), adding "default" to the protected list makes the current implementation less dangerous. |
From a view with 4 items… $ rtxmlrpc d.multicall.filtered '' tagged 'and={(d.is_open),(d.ignore_commands)}' d.hash= d.is_open= d.ignore_commands=
['8D…05', 1, 1]
['F8…9D', 1, 1] |
Wow! I don't think that I ever knew about this! Thanks for the reminder.
Which command do you mean?
I'm not sure anymore (with your revelation), again :) Since temp-filtering fits completely to the general filtering of rtorrent, and with the use of the proposed excluded option we can clearly stop harming our code.
So, @rakshasa , what do you think about this feature? @toff : will you modify this pull request with the mentioned changes or shall I create a new one instead of this? |
@chros73 I don't use pyroscope / rtxmlrpc so I may be missing somethings. |
That's correct until you use rtorrent-ps with which you can assign keyboard shortcuts to different objects, e.g. to existing or custom views.
You don't have to use it, as @pyroscope mentioned you can use config snippets that rely on unfiltered (full) list of downloads (like auto scraping).
I think it's not enough.
I hope it makes sense. |
@toff : I implemented @pyroscope's suggestion about having
Changes:
Can you also add the previously mentioned Thanks |
- Certain views can be excluded from subfiltering via view.temp_filter.excluded config option - its default value: "default,started,stopped" - example usage in config: view.temp_filter.excluded.set="default,started,stopped,leeching" - Log messages can be displayed when temp filtering occured - disabled by default - can be enabled with: ui.console.log.tempfilter.set=1
@chros73 |
Cool, Thank You! |
|
@toff, can you rename |
ui.console.log.tempfilter => view.temp_filter.log
Similar but ‘search instead of filter’ implementation at pyroscope/rtorrent-ps@b8a640b |
By using 'F' in the main view window you can enter a regex that will be used to filter the current view based on the torrent name.
To remove the filter set the input to empty.
This is adding a 'view.temp_filter' property and a 'match{}' function.
For example with Ctrl+X you could do:
command> view.temp_filter=main,"match={d.name=,.*linux.*iso}"
Edited 2017/04/17 15:00 : Added chros73 more detailed description.
Edited 2017/01/08 11:00 : Fixed some ambiguity in the description.