Skip to content

Commit f254606

Browse files
chroschros
chros
authored and
chros
committed
Fix timestamp bugs in rtorrent config file and add a general method to display them (See #1)
1 parent c8d756c commit f254606

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/pyrocore/data/config/rtorrent-0.8.6.rc

+18-9
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,30 @@ system.method.insert = startup_time,value|const,$system.time=
3030
# tm_started = time of *first* start
3131
# tm_completed = time of completion
3232
system.method.insert = pyro.tm_started.now,simple|private,"d.set_custom=tm_started,$cat=$system.time= ;d.save_session="
33-
system.method.set_key = event.download.resumed,time_stamp,"branch=d.get_custom=tm_started,false=,pyro.tm_started.now="
34-
system.method.set_key = event.download.inserted_new,time_stamp,"d.set_custom=tm_loaded,$cat=$system.time= ;d.save_session="
35-
system.method.set_key = event.download.finished,time_stamp,"d.set_custom=tm_completed,$cat=$system.time= ;d.save_session="
33+
system.method.set_key = event.download.resumed,time_stamp_r,"branch=d.get_custom=tm_started,false=,pyro.tm_started.now="
34+
system.method.set_key = event.download.inserted_new,time_stamp_i,"d.set_custom=tm_loaded,$cat=$system.time= ;d.save_session="
35+
system.method.insert = pyro.tm_completed.now,simple|private,"d.set_custom=tm_completed,$cat=$system.time= ;d.save_session="
36+
system.method.set_key = event.download.finished,time_stamp_f,"pyro.tm_completed.now="
37+
system.method.set_key = event.download.hash_done,time_stamp_h,"branch=\"and={d.complete=,not=$d.get_custom=tm_completed}\",pyro.tm_completed.now="
3638

3739
# EVENTS: Activation intervals
3840
system.method.insert = pyro.activations.append,simple|private,"d.set_custom=activations,\"$cat=$d.get_custom=activations,$argument.0=,$system.time=\" ;d.save_session="
3941
system.method.set_key = event.download.paused,activations,"pyro.activations.append=P"
4042
system.method.set_key = event.download.resumed,activations,"pyro.activations.append=R"
4143

42-
# SCHEDULE: Set "last_active" custom field for items that have peers
43-
system.method.insert = d.last_active, simple|value, "if=$d.peers_connected=,$cat=$system.time=,$d.custom=last_active"
44-
schedule = update_last_active,24,42,"d.multicall=started,\"branch=$d.peers_connected=,\\\"d.custom.set=last_active,$cat=$system.time=\\\"\""
45-
system.method.insert = d.last_active.print, simple|private, "print=\"$cat={$convert.date=$d.last_active=, \\\" \\\", $convert.time=$d.last_active=}\""
46-
system.method.set_key = event.download.resumed,last_active,"d.set_custom=last_active,$cat=$system.time= ;d.save_session="
47-
system.method.set_key = event.download.finished,last_active,"d.set_custom=last_active,$cat=$system.time= ;d.save_session="
44+
# SCHEDULE/EVENTS: Set "last_active" custom field for items that have peers
45+
system.method.insert = d.last_active, simple, "if=$d.peers_connected=,$cat=$system.time=,$d.custom=last_active"
46+
system.method.insert = d.last_active.set, simple|private, "d.set_custom=last_active,$cat=$system.time= ;branch=argument.0=,d.save_session="
47+
schedule = update_last_active,24,42,"d.multicall=started,\"branch=$d.peers_connected=,d.last_active.set=\""
48+
system.method.set_key = event.download.resumed,last_active_r,"branch=\"or={d.peers_connected=,not=$d.custom=last_active}\",d.last_active.set=1"
49+
system.method.set_key = event.download.finished,last_active_f,"d.last_active.set=1"
50+
51+
# Display any valid timestamp value in human readable format or print the value itself (e.g.: 30/06/2013 23:47:33).
52+
# Usage: hrf_time=<<timefield>> (e.g.: hrf_time=$d.last_active= , hrf_time=$d.custom=tm_loaded)
53+
# helper method: to display any timestamp field (e.g. d.creation_date= , d.custom=tm_started) in human readable format
54+
system.method.insert = hrf_time.helper, simple|private, "print=\"$cat={$convert.date=$argument.0=, \\\" \\\", $convert.time=$argument.0=}\""
55+
# method to display any timestamp field in human readable format if the value greater than 0 otherwise print the value itself
56+
system.method.insert = hrf_time, simple, "branch=\"greater={argument.0=,cat=0}\",hrf_time.helper=$argument.0=,print=$argument.0="
4857

4958
# UI/VIEW: Default view for filtering results (bound to '^' key in rT-PS)
5059
view_add = rtcontrol

0 commit comments

Comments
 (0)