Opened 12 years ago
Closed 9 years ago
#4285 closed Enhancement (duplicate)
Run script after other events
Reported by: | Trina | Owned by: | jordan |
---|---|---|---|
Priority: | Normal | Milestone: | None Set |
Component: | libtransmission | Version: | 2.31 |
Severity: | Normal | Keywords: | script events |
Cc: |
Description
Would it be possible to run the torrent-done script after other events and pass in the event type as an environment variable? In particular, I would like to perform certain actions when a torrent is first added and when it is finished (completed seeding).
I found other people asking for this feature, but never as a separate ticket, always as comments to existing tickets: ticket:1796#comment:36, ticket:1796#comment:42, ticket:162#comment:3. And here's some links to relevant forum requestions: 1, 2, 3.
Change History (3)
comment:1 Changed 12 years ago by jordan
comment:2 Changed 12 years ago by Trina
Well, it can be just a single script that the user can customize to take different actions depending upon the event type. For those of us using the daemon instead of a native client, there are none of the fancy notifications. It would be simple to accomplish something similar with a single script that could just do something like:
echo $TR_TORRENT_NAME changed state to $TR_TORRENT_STATE | $NOTIFICATION_PROGRAM
Also, I have several simple tasks that I currently implement using the polling method as frequently suggested in the forums. However, certain events are hard to check for using simple bash scripts. One case is when a torrent is manually deleted. This is hard to implement in bash, since it requires comparing the info from the current run to the previous run. I am hoping a deleted torrent would trigger an finished event if it had already completed downloading, or at least it would be possible to infer from the given data.
comment:3 Changed 9 years ago by livings124
- Resolution set to duplicate
- Status changed from new to closed
The only other state I could imagine this for is running a script when seeding completes. That's covered by #5484.
This could get pretty crazy. Are there really that many use cases for all these scripts?