-
Notifications
You must be signed in to change notification settings - Fork 1.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
torrent clients support (transmission-daemon) #2617
Comments
Interesting idea! Currently, I think most people just disable |
On 2017-06-29 20:36:52, Adrian Sampson wrote:
Interesting idea! Currently, I think most people just disable `write`, `move`, and `copy` to leave all the files in place. Would that suffice for your case?
that is exactly what i do now, but i would like to fix tags for files
that are *not* covered by torrent files at least then make a choice for
those that are: if the change is minor, leave it alone, but if the tags
are too messed up, remove it from the torrent.
|
Interesting. Maybe one strategy, then, would be to leave the If you're interested in putting together a plugin, yes, the |
does |
No, |
how do we prevent moving? is it the same mechanism as write? |
I don't have any specific ideas about preventing moving—that's not something anyone's wanted to do before. But you can try hooking into the various moving-related plugin events, or dive into the code for the importer or the |
This could be solved by my proposal in #2835, by adding a command that checks "loaded into client" and then |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
i wonder if i can just keep this issue open to keep tracking this problem, self-assigning as i may eventually deal with this, but feel free to take it on if you have time! |
and it does seem like such a "skip" hook would be the solution here, yeah. |
looking again at the code, it looks like in
there is already:
i think that would cover all cases where existing files would get modified or removed. copied or hardlinked files we care less about here, because they do not matter for existing torrents, as clients typically ignore extra files. we also need to somehow pass information from the plugin to the caller. right now the maybe the safest would be to raise an exception from the plugin. older versions of beets would just fail to do the operation and crash (a possible acceptable failure mode, as in "fail closed"), newer versions could handle the exception and behave correctly (e.g. skip or abort, depending on the exception)? right now it seems like any makes sense? |
This reflects the `try_write` approach will handles write failures elegantly, by logging the error and continuing. We do the same with `move`, `art_set` and `move_art`. We also handle exceptions on `before_item_moved` and `art_set` plugins hooks, the latter of which is moved *before* the file operations to remain consistent with other hook configurations. That might be a mistake and API-breaking change, another approach would be to have a new `before_art_set` hook instead. We also introduce a new hook (`move_art`) for those operations as well. The point of this patch is to make it possible for plugins to send a signal (through the already FileOperationError exception) to callers that it should skip a specific item or artwork. This is essential to allow beets to better integrate with other utilities like bittorrent clients which may rewrite those files. The rationale here is that some music collections will have *parts* of them managed by such clients in which case we should be careful not to overwrite or move those files. Operations like copy or hardlink are not handled by this, for that reason. We may also want to do proper error handling for those as well, that said, but that seems out of scope for this specific issue (#2617).
a draft of this now lives in #4230. |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
following up on my old self, i wrote a small script that lists all files under transmission: https://gitlab.com/anarcat/scripts/-/blob/main/transmission-list-all-files?ref_type=heads i think my next step is to |
Problem
Some of the files managed by beets may be seeded on torrent files to share with your friends.
If beets modifies those files, this will break the checksums from the torrent files, and some torrent clients will obviously be confused by this. Some will just warn the user, others won't do anything. In general, one can assume clients will start re-downloading the affected chunks, overwriting the changes performed by beets.
Setup
N/A
Proposed solution
I envision a plugin that would either deny writes on torrent-managed files or remove files from the torrent client when beets modifies them. This behavior could obviously be customizable from the configuration file.
The same question as with #2616 exists here: I assume I would need to hook into
before_item_moved
andwrite
to do this. But i'm not clear how or if i can deny moving items at all?With transmission, my current client of choice, there's a commandline tool (transmission-remote) that can be used to manipulate torrent files (add/remove/list etc). This is backed by an RPC interface that's basically JSON over HTTP which should be fairly easy to use.
The text was updated successfully, but these errors were encountered: