Pomoc 2 suggestions to improve rTorrent

altaroinj

Passing Basics
Beginner
31 Marzec 2018
14
1
3
43
QNAP
TS-x53
Ethernet
1 GbE
Hello all,

first of all, and I may repeat myself, thanks again for rtorrent. It's one of the few apps I did not hesitate to pay for, and I don't regret it.

Then, I would like to suggest @Silas Mariusz 2 things to improve.

1. If it's not possible to automatically backup main configuration page at each stop/start of the app for example, do you think we could have a way to export/import it ?
Because, each time the app is updated, we need to reconfigure everything as the configuration is reset to default.

2. I use the feature that allows me to execute script on finished downloads. I use it mainly for sending notification on my phone using pushover service (I can share my script if someone wants to do the same).
But, rtorrent handles a lot of event types and some I would like to use too.
So I renamed "_event.download.finished" into "_event.download", and modified it in order to be able to do the same, but for all event types.
You can find it attached to the thread (with sh extension because otherwise it was not accepted).
Just to explain, I only set the 3 first arguments as mandatory, because for inserted* events there is no path yet for the downloaded file.
And I splitted log files (one by event type) as differrent event types can occur at the same time and logs of executed scripts would be mixed between each other if I hadn't.
I kept the main log file for debug purpose (if the DEBUG variable is set to 1).

So with this new script, I modified "rtorrent/etc/rtorrent.conf" in order to comment the line :
Kod:
# method.set_key = event.download.finished,bash_handlers2,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download.finished\"),$d.hash=,$d.name=,$d.base_path=,$d.custom1="

And I added these lines instead :
Kod:
method.set_key = event.download.closed,closed_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),closed,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.erased,erased_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),erased,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.finished,finished_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),finished,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.hash_done,hash_done_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),hash_done,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.hash_queued,hash_queued_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),hash_queued,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.hash_removed,hash_removed_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),hash_removed,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.inserted,inserted_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),inserted,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.inserted_new,inserted_new_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),inserted_new,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.inserted_session,inserted_session_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),inserted_session,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.opened,opened_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),opened,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.paused,paused_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),paused,$d.hash=,$d.name=,$d.base_path=,$d.custom1="
method.set_key = event.download.resumed,resumed_bash_handler,"execute.nothrow.bg=(cat,(cfg.scripts),\"_event.download\"),resumed,$d.hash=,$d.name=,$d.base_path=,$d.custom1="

Everything worked as expected.

My question now is, do you think @Silas Mariusz that these enhancements could be part of one of your further release (in order to avoid resetup everything after each update) ?

Thanks in advance for your response.

Firmware version: 4.4.2.1270 Build 20200410
Model name: QNAP TS-253Pro
 

Załączniki

  • _event.download.sh
    1,7 KB · Wyświetleń: 60
Thanks @Silas Mariusz
I installed the last version.
First, it didn’t changed the rtorrent.conf file.
So I stopped the app and deleted it.
At restart, rtorrent.conf.default was copied into rtorrent.conf and everything worked.
Finally, maybe this procedure would have worked with the previous package.
The fact that rtorrent.conf file is not overridden during application update, is it part of the new process that maintains overall configuration ?
Regards.
 
The fact that rtorrent.conf file is not overridden during application update, is it part of the new process that maintains overall configuration ?
Yes.

So I stopped the app and deleted it.
At restart, rtorrent.conf.default was copied into rtorrent.conf and everything worked.
You can simply upgrade app and then click:
upload_2020-7-7_14-55-26.png

to apply new changes.
If you dont, all new features will not be implemented unless you select them in config.
 
ffs! open NEW topic !
With this new version, is there a way I can get it to 'Stop and Clear' and then 30 mins later 'Remove and delete data'?
My question now is, do you think
1.gif
@Silas Mariusz that these enhancements could be part of one of your further release (in order to avoid resetup everything after each update) ?
I like your idea with many types events. Honestly no one asked for this before, but my idea is to execute all these events from the scripts in subdirs like:
Rdownload\scripts\event.download.closed\_execute.script
Rdownload\scripts\event.download.erased\_execute.script
Rdownload\scripts\event.download.finished\_execute.script
...
Rdownload\scripts\event.download.resumed
So if you use same script for all events you will have to put it in each event directory. Is this okay?

I appreciate for your feedback.
Thank you!

@Silas Mariusz, I am referring to your own comments in this thread where you showed support for scripts that execute after a (download) event!
 
@altaroinj
I observed that triggering hash_done, hash_queued, hash_removed, inserted, inserted_session events makes no sense. And these events are executed when Rtorrent starts. Imagine you have 10k seeding torrents. In future release we have to remove these events to improve rtorrent start speed.