'Look up the NZB name in the history and see if it contains a record for self.nzb_name
:return: A (indexer_id, season, [], quality, version) tuple. The first two may be None if none were found.'

def _history_lookup(self):

    to_return = (None, None, [], None, None)
    if ((not self.nzb_name) and (not self.file_name)):
        self.in_history = False
        return to_return
    names = []
    if self.nzb_name:
        names.append(self.nzb_name)
        if (u'.' in self.nzb_name):
            names.append(self.nzb_name.rpartition(u'.')[0])
    if self.file_name:
        names.append(self.file_name)
        if (u'.' in self.file_name):
            names.append(self.file_name.rpartition(u'.')[0])
    for curName in names:
        dbData = [x[u'doc'] for x in sickrage.srCore.mainDB.db.all(u'history', with_doc=True) if (curName in x[u'doc'][u'resource'])]
        if (len(dbData) == 0):
            continue
        indexer_id = int(dbData[0][u'showid'])
        season = int(dbData[0][u'season'])
        quality = int(dbData[0][u'quality'])
        version = int(dbData[0][u'version'])
        if (quality == Quality.UNKNOWN):
            quality = None
        show = findCertainShow(sickrage.srCore.SHOWLIST, indexer_id)
        self.in_history = True
        self.version = version
        to_return = (show, season, [], quality, version)
        qual_str = (Quality.qualityStrings[quality] if (quality is not None) else quality)
        self._log(u'Found    result    in    history    for    {}    -    Season:    {}    -    Quality:    {}    -    Version:    {}'.format((show.name if show else u'UNDEFINED'), season, qual_str, version), sickrage.srCore.srLogger.DEBUG)
        return to_return
    self.in_history = False
    return to_return
