lib/sabnzbd.rb in sabnzbd-0.1.0 vs lib/sabnzbd.rb in sabnzbd-0.1.1

- old
+ new

@@ -15,30 +15,30 @@ def simple_queue make_request end def paused? - make_request["paused"] + make_request["queue"]["paused"] end def slots @slots ||= initialize_slots end private - def make_request(url = "/api?mode=qstatus&output=json&apikey=#{@api_key}") + def make_request(url = "/api?mode=queue&start=START&limit=LIMIT&output=json&apikey=#{@api_key}") verify_response( self.class.get(url).parsed_response ) end def verify_response response raise ApiKeyInvalid.new, "Api key invalid #{@api_key}" if response["status"] == false && response["error"] response end def initialize_slots - jobs = make_request["jobs"] + jobs = make_request["queue"]["slots"] jobs.each.inject([]) do |arr, job| arr << Sabnzbd::Slot.new(job) end end \ No newline at end of file