'Get the downloaded and/or snatched history'

def run(self):

    data = History().get(self.limit, self.type)
    results = []
    for row in data:
        (status, quality) = Quality.splitCompositeStatus(int(row['action']))
        status = _get_status_strings(status)
        if (self.type and (not (status.lower() == self.type))):
            continue
        row['status'] = status
        row['quality'] = get_quality_string(quality)
        row['date'] = _history_date_to_datetime_form(str(row['date']))
        del row['action']
        _rename_element(row, u'show_id', u'indexerid')
        row['resource_path'] = ek(os.path.dirname, row['resource'])
        row['resource'] = ek(os.path.basename, row['resource'])
        row['tvdbid'] = row['indexerid']
        results.append(row)
    return _responds(RESULT_SUCCESS, results)
