 
     await @idsAndCountByState queue, state,  ideally defer list
     await @fullKeysForList list,             ideally defer names
-    await @formatJobs queue, names,          ideally defer jobs
+    await @formatJobsForState queue, state, names, ideally defer jobs
     await @dataForJobs jobs,                 ideally defer jobs
     await @stacktraceForJobs jobs,           ideally defer jobs if state is "failed"
     await @progressForJobs jobs,             ideally defer jobs if state is "active"

      else 0

    callback null, jobs

  commandRemoveFromStateLists: (prefix, id) -> [
    ["lrem", "#{prefix}active",     0, id]

    callback null, keys

  #Returns all jobs in object form, with state applied to object. Ex: {id: 101, queue: "video transcoding", state: "pending"}
  formatJobsForState: (queue = "*", state, keys, callback) ->
    @formatJobsForStates queue, [state], keys, callback

  formatJobsForStates: (queue = "*", states, keys, callback) ->
    return callback() unless keys?.length
    ideally = errify callback
    jobs    = []

    for state in states
      await @idsAndCountByState queue, state, ideally defer {ids}
