'Get status of all active downloads
:param ids: list of (mixed) downloader ids
Used to match the releases for this downloader as there could be
other downloaders active that it should ignore
:return: list of releases'

def getAllDownloadStatus(self, ids):

    log.debug('Checking    NZBGet    download    status.')
    rpc = self.getRPC()
    try:
        if rpc.writelog('DETAIL', 'CouchPotato    connected    to    check    status'):
            log.debug('Successfully    connected    to    NZBGet')
        else:
            log.info('Successfully    connected    to    NZBGet,    but    unable    to    send    a    message')
    except socket.error:
        log.error('NZBGet    is    not    responding.    Please    ensure    that    NZBGet    is    running    and    host    setting    is    correct.')
        return []
    except xmlrpclib.ProtocolError as e:
        if (e.errcode == 401):
            log.error('Password    is    incorrect.')
        else:
            log.error('Protocol    Error:    %s', e)
        return []
    try:
        status = rpc.status()
        groups = rpc.listgroups()
        queue = rpc.postqueue(0)
        history = rpc.history()
    except:
        log.error('Failed    getting    data:    %s', traceback.format_exc(1))
        return []
    release_downloads = ReleaseDownloadList(self)
    for nzb in groups:
        try:
            nzb_id = [param['Value'] for param in nzb['Parameters'] if (param['Name'] == 'couchpotato')][0]
        except:
            nzb_id = nzb['NZBID']
        if (nzb_id in ids):
            log.debug('Found    %s    in    NZBGet    download    queue', nzb['NZBFilename'])
            timeleft = (-1)
            try:
                if ((nzb['ActiveDownloads'] > 0) and (nzb['DownloadRate'] > 0) and (not (status['DownloadPaused'] or status['Download2Paused']))):
                    timeleft = str(timedelta(seconds=(((nzb['RemainingSizeMB'] / status['DownloadRate']) * 2) ^ 20)))
            except:
                pass
            release_downloads.append({'id': nzb_id, 'name': nzb['NZBFilename'], 'original_status': ('DOWNLOADING' if (nzb['ActiveDownloads'] > 0) else 'QUEUED'), 'timeleft': timeleft})
    for nzb in queue:
        if (nzb['NZBID'] in ids):
            log.debug('Found    %s    in    NZBGet    postprocessing    queue', nzb['NZBFilename'])
            release_downloads.append({'id': nzb['NZBID'], 'name': nzb['NZBFilename'], 'original_status': nzb['Stage'], 'timeleft': (str(timedelta(seconds=0)) if (not status['PostPaused']) else (-1))})
    for nzb in history:
        try:
            nzb_id = [param['Value'] for param in nzb['Parameters'] if (param['Name'] == 'couchpotato')][0]
        except:
            nzb_id = nzb['NZBID']
        if (nzb_id in ids):
            log.debug('Found    %s    in    NZBGet    history.    TotalStatus:    %s,    ParStatus:    %s,    ScriptStatus:    %s,    Log:    %s', (nzb['NZBFilename'], nzb['Status'], nzb['ParStatus'], nzb['ScriptStatus'], nzb['Log']))
            release_downloads.append({'id': nzb_id, 'name': nzb['NZBFilename'], 'status': ('completed' if ('SUCCESS' in nzb['Status']) else 'failed'), 'original_status': nzb['Status'], 'timeleft': str(timedelta(seconds=0)), 'folder': sp(nzb['DestDir'])})
    return release_downloads
