Private GIT

Skip to content
Snippets Groups Projects
Commit 935e48b3 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Skip non propers before snatching them, and log which provider is returning...

Skip non propers before snatching them, and log which provider is returning non-proper. Also search downloaded and not only snatched when matching propers.
parent 05633fc4
Branches
Tags
No related merge requests found
......@@ -87,17 +87,21 @@ class ProperFinder():
logger.log(u"Error while searching " + curProvider.name + ", skipping: " + ex(e), logger.ERROR)
logger.log(traceback.format_exc(), logger.DEBUG)
continue
finally:
threading.currentThread().name = origThreadName
# if they haven't been added by a different provider than add the proper to the list
for x in curPropers:
if not re.search('(^|[\. _-])(proper|repack)([\. _-]|$)', x.name, re.I):
logger.log(u'findPropers returned a non-proper, we have caught and skipped it but please report this', logger.WARNING)
continue
name = self._genericName(x.name)
if not name in propers:
logger.log(u"Found new proper: " + x.name, logger.DEBUG)
x.provider = curProvider
propers[name] = x
threading.currentThread().name = origThreadName
# take the list of unique propers and get it sorted by
sortedPropers = sorted(propers.values(), key=operator.attrgetter('date'), reverse=True)
finalPropers = []
......@@ -205,7 +209,7 @@ class ProperFinder():
historyResults = myDB.select(
"SELECT resource FROM history " +
"WHERE showid = ? AND season = ? AND episode = ? AND quality = ? AND date >= ? " +
"AND action IN (" + ",".join([str(x) for x in Quality.SNATCHED]) + ")",
"AND action IN (" + ",".join([str(x) for x in Quality.SNATCHED + Quality.DOWNLOADED]) + ")",
[curProper.indexerid, curProper.season, curProper.episode, curProper.quality,
historyLimit.strftime(history.dateFormat)])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment