'Find releases in history by show ID and season.
Return None for release if multiple found or no release found.'

@staticmethod
def findFailedRelease(epObj):

    release = None
    provider = None
    dbData = sorted([x[u'doc'] for x in sickrage.srCore.failedDB.db.get_many(u'history', epObj.show.indexerid, with_doc=True) if ((x[u'doc'][u'season'] == epObj.season) and (x[u'doc'][u'episode'] == epObj.episode))], key=(lambda d: d[u'date']))
    [sickrage.srCore.failedDB.db.delete(x) for x in dbData[1::None]]
    for dbData in [x[u'doc'] for x in sickrage.srCore.failedDB.db.get_many(u'history', epObj.show.indexerid, with_doc=True) if ((x[u'doc'][u'season'] == epObj.season) and (x[u'doc'][u'episode'] == epObj.episode))]:
        release = str(dbData[u'release'])
        provider = str(dbData[u'provider'])
        date = dbData[u'date']
        for x in [x[u'doc'] for x in sickrage.srCore.failedDB.db.all(u'history', with_doc=True)]:
            if ((x[u'release'] == release) and (x[u'date'] != date)):
                sickrage.srCore.failedDB.db.delete(x)
        sickrage.srCore.srLogger.debug((u'Failed    release    found    for    season    (%s):    (%s)' % (epObj.season, dbData[u'release'])))
        return (release, provider)
    sickrage.srCore.srLogger.debug((u'No    releases    found    for    season    (%s)    of    (%s)' % (epObj.season, epObj.show.indexerid)))
    return (release, provider)
