'For a given file try to find the showid, season, and episode.
:return: A (show, season, episodes, quality, version) tuple'

def _find_info(self):

    show = season = quality = version = None
    episodes = []
    attempt_list = [self._history_lookup, (lambda : self._analyze_name(self.nzb_name)), (lambda : self._analyze_name(self.file_name)), (lambda : self._analyze_name(self.folder_name)), (lambda : self._analyze_name(self.file_path)), (lambda : self._analyze_name(((self.folder_name + u'    ') + self.file_name)))]
    for cur_attempt in attempt_list:
        try:
            (cur_show, cur_season, cur_episodes, cur_quality, cur_version) = cur_attempt()
        except (InvalidNameException, InvalidShowException) as error:
            logger.log(u'{0}'.format(error), logger.DEBUG)
            continue
        if (not cur_show):
            continue
        else:
            show = cur_show
        if (cur_quality and (not (self.in_history and quality))):
            quality = cur_quality
        if (cur_version is not None):
            version = cur_version
        if (cur_season is not None):
            season = cur_season
        if cur_episodes:
            episodes = cur_episodes
        if ((season == (-1)) and show and episodes):
            self._log(u'Looks    like    this    is    an    air-by-date    or    sports    show,    attempting    to    convert    the    date    to    season/episode', logger.DEBUG)
            try:
                airdate = episodes[0].toordinal()
            except AttributeError:
                self._log(u'Could    not    convert    to    a    valid    airdate:    {0}'.format(episodes[0]), logger.DEBUG)
                episodes = []
                continue
            main_db_con = db.DBConnection()
            sql_result = main_db_con.select(u'SELECT    season,    episode    FROM    tv_episodes    WHERE    showid    =    ?    and    indexer    =    ?    and    airdate    =    ?    and    season    !=    0', [show.indexerid, show.indexer, airdate])
            if sql_result:
                season = int(sql_result[0]['season'])
                episodes = [int(sql_result[0]['episode'])]
            else:
                sql_result = main_db_con.select(u'SELECT    season,    episode    FROM    tv_episodes    WHERE    showid    =    ?    and    indexer    =    ?    and    airdate    =    ?', [show.indexerid, show.indexer, airdate])
                if sql_result:
                    season = int(sql_result[0]['season'])
                    episodes = [int(sql_result[0]['episode'])]
                else:
                    self._log(((((u'Unable    to    find    episode    with    date    ' + str(episodes[0])) + u'    for    show    ') + str(show.indexerid)) + u',    skipping'), logger.DEBUG)
                    episodes = []
                    continue
        elif ((season is None) and show):
            main_db_con = db.DBConnection()
            numseasonsSQlResult = main_db_con.select(u'SELECT    COUNT(DISTINCT    season)    FROM    tv_episodes    WHERE    showid    =    ?    and    indexer    =    ?    and    season    !=    0', [show.indexerid, show.indexer])
            if ((int(numseasonsSQlResult[0][0]) == 1) and (season is None)):
                self._log(u"Don't    have    a    season    number,    but    this    show    appears    to    only    have    1    season,    setting    season    number    to    1...", logger.DEBUG)
                season = 1
        if (show and season and episodes):
            return (show, season, episodes, quality, version)
    return (show, season, episodes, quality, version)
