[Libtorrent-devel] Trying to display seeding time but having trouble with the if= command
Perl Whore
whoreperl at gmail.com
Mon Jun 7 11:27:17 UTC 2010
I got it. Incase anyone is looking to do the same, this is what I did:
I put this in src/ui/download.cc
element->push_column("Load
time:",te_command("cat=$to_date=$d.get_custom=load_time,\"
\",$to_time=$d.get_custom=load_time"));
element->push_column("Completion
time:",te_command("if=$d.get_custom=is_done,\"$cat=$to_date=$d.get_custom=completion_time,\\\"
\\\",$to_time=$d.get_custom=completion_time\",Unknown"));
element->push_column("Seeding
time:",te_command("if=$d.get_custom=is_done,$to_elapsed_time=$d.get_custom=completion_time,Unknown"));
and in my .rtorrent.rc, I put this
system.method.set_key =
event.download.inserted_new,01_set_time_variables,"d.set_custom=load_time,\"$execute_capture={perl,-e,print,-e,time;}\";\
d.set_custom=completion_time,$d.get_custom=load_time"
system.method.set_key =
event.download.finished,01_set_completion_time,"d.set_custom=completion_time,\"$execute_capture={perl,-e,print,-e,time;}\""
system.method.set_key =
event.download.finished,02_is_done,"d.set_custom=is_done,1"
system.method.set_key =
event.download.hash_done,01_set_completion_time,"d.set_custom=is_done,1"
If there's a more elegant way to do this, please let me know.
On Mon, Jun 7, 2010 at 10:20 AM, Perl Whore <whoreperl at gmail.com> wrote:
> I need a rough idea about the seeding time, so I added this line in
> src/ui/download.cc
>
> element->push_column("Seeding
> time:",te_command("if=$d.get_custom=completion_time,$to_elapsed_time=$d.get_custom=completion_time,Unknown"));
>
> This works fine if $d.get_custom=completion_time is set, or else
> rTorrent exits saying "Not a value"; Shouldn't the $to_elapsed_time be
> evaluated only if the the if statement is true?
>
> Another way I thought I could do this is set the initial value of
> d.set_custom=completion_time to 0 when a torrent is loaded, and then
> check with the less command if this value is less than 1, and if so,
> display "Unknown", else evaluate to_elapsed_time, but I'm not very
> sure how to use the less command.
>
More information about the Libtorrent-devel
mailing list