-
Notifications
You must be signed in to change notification settings - Fork 34
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
Cannot get files of a torrent without unnecessary priorities and wanted fields #455
Comments
(As a note to others who find this issue before it's fixed) A hacky workaround to this without actually fetching the additional fields is to just manually set the internal field state of the torrent yourself before calling torrent.fields["priorities"] = [0] * len(torrent.fields["files"])
torrent.fields["wanted"] = [True] * len(torrent.fields["files"])
# get_files() should now work
torrent.get_files() |
ref #446 |
A bit weird to close this issue because it's definitely not fixed by the mention of an unmerged PR. Unless you're saying you won't fix? Should probably separate #446 out, or at least address separately since there's 2 different issues:
|
Shouldn't this issue remain open until at least it's merged then? |
Yes, both your suggestions on splitting PR and keep issue open sounds reasonable to me. But I'm don't want to spend time on that PR just split it into 2 PR and resolve conflicts when I plan to merge it, so I'll just only re-open this issue. |
Yeah sounds good. It's just helpful to track this as an open issue. I appreciate it! |
for tracking, I want to avoid unnecessary breaking change so I will merge PR and make new release when new transmission version is released. |
you can use pip to install zip of PR if you need it now. |
Description
Currently, it is impossible to get files of a torrent (with the
.get_files()
interface) unless you fetch thepriorities
andwanted
fields.This is due to trying to directly reference these fields here:
transmission-rpc/transmission_rpc/torrent.py
Lines 436 to 437 in 57c064f
It currently returns a key error if you try to use this:
This doesn't really seem necessary and forces fetching these fields onto users for use-cases that may not need them.
I would propose updating this function or providing an alternative interface to get the files of a
Torrent
class(as a side note, why are getting files a function interface while everything else on the class is a property? It seems a bit weird/inconsistent)
The text was updated successfully, but these errors were encountered: