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

Filter qbt list command by torrent state. #40

Merged
merged 3 commits into from
May 22, 2023

Conversation

xel86
Copy link
Contributor

@xel86 xel86 commented Dec 25, 2022

Allows for the qbt list command to be filtered to list only the torrents specified by a state argument, like downloading.

For example:
qbt list --filter=active will list all active torrents currently downloading or uploading.
qbt list will continue to list all torrents.

New flags:

  • --filter,-f - takes a single qbit state as filter
  • --category,-c - takes a single category
  • --tag,-t - takes a single tag
  • --hashes,-h - takes one or multiple hashes separated by | pipe: "hash1|hash2"

Also removed the uploading TorrentFilter from domains.go since it is not a valid filter for the qbittorrent api, and added the missing errored filter. (https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-list)

Fixes #46

Copy link
Owner

@ludviglundgren ludviglundgren left a comment

Choose a reason for hiding this comment

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

Hello! Thanks for the PR :)

Left some feedback on good and simple improvements!

cmd/list.go Outdated Show resolved Hide resolved
cmd/list.go Outdated Show resolved Hide resolved
pkg/qbittorrent/domain.go Outdated Show resolved Hide resolved
* qbt pass ctx everywhere
* update all cmd handlers
@ludviglundgren ludviglundgren added the enhancement New feature or request label May 22, 2023
Copy link
Owner

@ludviglundgren ludviglundgren left a comment

Choose a reason for hiding this comment

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

I did just a bit of refactoring 😄

Changed the args from state to filter and also added category, tag, hashes.

Updated the qbit client to take a context everywhere, so requests can be cancelled.

More to come!

@ludviglundgren ludviglundgren merged commit 3197b04 into ludviglundgren:develop May 22, 2023
@xel86
Copy link
Contributor Author

xel86 commented May 25, 2023

Sorry about that, been very busy lately and completely forgot about this PR. Thanks for the improvements :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move not working on qBit 4.5.2
2 participants