'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[u'action']))
        status = _get_status_Strings(status)
        if (self.type and (not (status.lower() == self.type))):
            continue
        row[u'status'] = status
        row[u'quality'] = get_quality_string(quality)
        row[u'date'] = _historyDate_to_dateTimeForm(str(row[u'date']))
        del row[u'action']
        _rename_element(row, u'show_id', u'indexerid')
        row[u'resource_path'] = os.path.dirname(row[u'resource'])
        row[u'resource'] = os.path.basename(row[u'resource'])
        row[u'tvdbid'] = row[u'indexerid']
        results.append(row)
    return _responds(RESULT_SUCCESS, results)
