'Walk providers for propers'

def _getProperList(self):

    propers = {}
    search_date = (datetime.datetime.today() - datetime.timedelta(days=2))
    origThreadName = threading.currentThread().getName()
    for (providerID, providerObj) in sickrage.srCore.providersDict.sort(randomize=sickrage.srCore.srConfig.RANDOMIZE_PROVIDERS).items():
        if ((not sickrage.srCore.srConfig.USE_NZBS) and (providerObj.type in [NZBProvider.type, NewznabProvider.type])):
            continue
        elif ((not sickrage.srCore.srConfig.USE_TORRENTS) and (providerObj.type in [TorrentProvider.type, TorrentRssProvider.type])):
            continue
        elif (not providerObj.isEnabled):
            continue
        threading.currentThread().setName((((origThreadName + u'    ::    [') + providerObj.name) + u']'))
        sickrage.srCore.srLogger.info((u'Searching    for    any    new    PROPER    releases    from    ' + providerObj.name))
        try:
            curPropers = providerObj.find_propers(search_date)
        except AuthException as e:
            sickrage.srCore.srLogger.warning(u'Authentication    error:    {}'.format(e.message))
            continue
        except Exception as e:
            sickrage.srCore.srLogger.debug(((u'Error    while    searching    ' + providerObj.name) + u',    skipping:    {}'.format(e.message)))
            sickrage.srCore.srLogger.debug(traceback.format_exc())
            continue
        for x in curPropers:
            if (not re.search(u'(^|[\\.    _-])(proper|repack)([\\.    _-]|$)', x.name, re.I)):
                sickrage.srCore.srLogger.debug(u'findPropers    returned    a    non-proper,    we    have    caught    and    skipped    it.')
                continue
            name = self._genericName(x.name)
            if (not (name in propers)):
                sickrage.srCore.srLogger.debug((u'Found    new    proper:    ' + x.name))
                x.provider = providerObj
                propers[name] = x
        threading.currentThread().setName(origThreadName)
    sortedPropers = sorted(propers.values(), key=operator.attrgetter(u'date'), reverse=True)
    finalPropers = []
    for curProper in sortedPropers:
        try:
            myParser = NameParser(False)
            parse_result = myParser.parse(curProper.name)
        except InvalidNameException:
            sickrage.srCore.srLogger.debug(((u'Unable    to    parse    the    filename    ' + curProper.name) + u'    into    a    valid    episode'))
            continue
        except InvalidShowException:
            sickrage.srCore.srLogger.debug(((u'Unable    to    parse    the    filename    ' + curProper.name) + u'    into    a    valid    show'))
            continue
        if (not parse_result.series_name):
            continue
        if (not parse_result.episode_numbers):
            sickrage.srCore.srLogger.debug(((u'Ignoring    ' + curProper.name) + u"    because    it's    for    a    full    season    rather    than    specific    episode"))
            continue
        sickrage.srCore.srLogger.debug((((u'Successful    match!    Result    ' + parse_result.original_name) + u'    matched    to    show    ') + parse_result.show.name))
        curProper.indexerid = parse_result.indexerid
        curProper.indexer = parse_result.show.indexer
        curProper.show = parse_result.show
        curProper.season = (parse_result.season_number if (parse_result.season_number is not None) else 1)
        curProper.episode = parse_result.episode_numbers[0]
        curProper.release_group = parse_result.release_group
        curProper.version = parse_result.version
        curProper.quality = Quality.nameQuality(curProper.name, parse_result.is_anime)
        curProper.content = None
        bestResult = pickBestResult(curProper, parse_result.show)
        if (not bestResult):
            sickrage.srCore.srLogger.debug(((u'Proper    ' + curProper.name) + u'    were    rejected    by    our    release    filters.'))
            continue
        if bestResult.show.is_anime:
            if ((not bestResult.release_group) and (bestResult.version == (-1))):
                sickrage.srCore.srLogger.debug(((u'Proper    ' + bestResult.name) + u"    doesn't    have    a    release    group    and    version,    ignoring    it"))
                continue
        dbData = [x[u'doc'] for x in sickrage.srCore.mainDB().db.get_many(u'tv_episodes', bestResult.indexerid, with_doc=True) if ((x[u'doc'][u'season'] == bestResult.season) and (x[u'doc'][u'episode'] == bestResult.episode))]
        if (not dbData):
            continue
        (oldStatus, oldQuality) = Quality.splitCompositeStatus(int(dbData[0][u'status']))
        if ((oldStatus not in (DOWNLOADED, SNATCHED)) or (oldQuality != bestResult.quality)):
            continue
        if bestResult.show.is_anime:
            dbData = [x[u'doc'] for x in sickrage.srCore.mainDB.db.get_many(u'tv_episodes', bestResult.indexerid, with_doc=True) if ((x[u'doc'][u'season'] == bestResult.season) and (x[u'doc'][u'episode'] == bestResult.episode))]
            oldVersion = int(dbData[0][u'version'])
            oldRelease_group = dbData[0][u'release_group']
            if ((-1) < oldVersion < bestResult.version):
                sickrage.srCore.srLogger.info((((u'Found    new    anime    v' + str(bestResult.version)) + u'    to    replace    existing    v') + str(oldVersion)))
            else:
                continue
            if (oldRelease_group != bestResult.release_group):
                sickrage.srCore.srLogger.info((((u'Skipping    proper    from    release    group:    ' + bestResult.release_group) + u',    does    not    match    existing    release    group:    ') + oldRelease_group))
                continue
        if ((bestResult.indexerid != (-1)) and ((bestResult.indexerid, bestResult.season, bestResult.episode) not in map(operator.attrgetter(u'indexerid', u'season', u'episode'), finalPropers))):
            sickrage.srCore.srLogger.info((u'Found    a    proper    that    we    need:    ' + str(bestResult.name)))
            finalPropers.append(bestResult)
    return finalPropers
