no download
Code: Select all
[root@amahi some_testing]# ruby test_sabnzbd.rb
data['jobs'][0].size = 0
data['jobs'][0] = {}
There are no downloads ongoing. HDA can be suspended.
[root@amahi some_testing]#
one download
Code: Select all
[root@amahi some_testing]# ruby test_sabnzbd.rb
data['jobs'][0].size = 1
data['jobs'][0] = {"job"=>[{"timeleft"=>["0:04:52"], "id"=>["SABnzbd_nzo_PcepWP"], "msgid"=>[{}], "filename"=>["top.gear.us.s02e07.hdtv.xvid-momentum.nfo"], "mbleft"=>["356.004081726"], "mb"=>["398.396969795"]}]}
There are downloads ongoing. HDA shall stay awake.
[root@amahi some_testing]#
two downloads, one waiting in queue
Code: Select all
[root@amahi some_testing]# ruby test_sabnzbd.rb
data['jobs'][0].size = 1
data['jobs'][0] = {"job"=>[{"timeleft"=>["0:03:27"], "id"=>["SABnzbd_nzo_PcepWP"], "msgid"=>[{}], "filename"=>["top.gear.us.s02e07.hdtv.xvid-momentum.nfo"], "mbleft"=>["258.936079025"], "mb"=>["398.396969795"]}, {"timeleft"=>["0:08:52"], "id"=>["SABnzbd_nzo_Tfueex"], "msgid"=>[{}], "filename"=>["top.gear.australia.s04e02.ws.pdtv.xvid-bwb-sample.avi"], "mbleft"=>["405.237011909"], "mb"=>["405.237011909"]}]}
There are downloads ongoing. HDA shall stay awake.
[root@amahi some_testing]#
hope this helps. the output seems to be working.
wouldnt it be simpeler to just monitor the disk activity in the cache and download folder of the sabnzbd app?
if that would work, then that would also work for uTorrent and Transmission app (for downloading torrents)...