def findRelease(epObj):
 release = None
 provider = None
 failed_db_con = db.DBConnection('failed.db')
 results = failed_db_con.select('SELECT release, provider, date FROM history WHERE showid=? AND season=? AND episode=?', [epObj.show.indexerid, epObj.season, epObj.episode])
 for result in results:
  release = str(result['release'])
  provider = str(result['provider'])
  date = result['date']
  failed_db_con.action('DELETE FROM history WHERE release=? AND date!=?', [release, date])
  logger.log(u'Failed release found for season ({0}): ({1})'.format(epObj.season, result['release']), logger.DEBUG)
  return (release, provider)
 logger.log(u'No releases found for season ({0}) of ({1})'.format(epObj.season, epObj.show.indexerid), logger.DEBUG)
 return (release, provider)

def findRelease ( epObj ) : release = None provider = None failed_db_con = db . DBConnection ( 'failed.db' ) results = failed_db_con . select ( 'SELECT release, provider, date FROM history WHERE showid=? AND season=? AND episode=?' , [ epObj . show . indexerid , epObj . season , epObj . episode ] ) for result in results : release = str ( result [ 'release' ] ) provider = str ( result [ 'provider' ] ) date = result [ 'date' ] failed_db_con . action ( 'DELETE FROM history WHERE release=? AND date!=?' , [ release , date ] ) logger . log ( u'Failed release found for season ({0}): ({1})' . format ( epObj . season , result [ 'release' ] ) , logger . DEBUG ) return ( release , provider ) logger . log ( u'No releases found for season ({0}) of ({1})' . format ( epObj . season , epObj . show . indexerid ) , logger . DEBUG ) return ( release , provider )
find releases in history by show id and season .