From f7b853287a0349c69eeab9385289ea49ab2ae725 Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 14 Jan 2012 13:59:31 +0100 Subject: [PATCH] Check for quality file size --- couchpotato/core/plugins/searcher/main.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/couchpotato/core/plugins/searcher/main.py b/couchpotato/core/plugins/searcher/main.py index b8fe3fa9..ffa01f6b 100644 --- a/couchpotato/core/plugins/searcher/main.py +++ b/couchpotato/core/plugins/searcher/main.py @@ -165,20 +165,17 @@ class Searcher(Plugin): log.info('Wrong: %s, looking for %s' % (nzb['name'], quality['label'])) return False - """ + # File to small - minSize = q.minimumSize(qualityType) - if minSize > item.size: - log.info('"%s" is too small to be %s. %sMB instead of the minimal of %sMB.' % (item.name, type['label'], item.size, minSize)) + if nzb['size'] and preferred_quality['size_min'] > nzb['size']: + log.info('"%s" is too small to be %s. %sMB instead of the minimal of %sMB.' % (nzb['name'], preferred_quality['label'], nzb['size'], preferred_quality['size_min'])) return False # File to large - maxSize = q.maximumSize(qualityType) - if maxSize < item.size: - log.info('"%s" is too large to be %s. %sMB instead of the maximum of %sMB.' % (item.name, type['label'], item.size, maxSize)) + if nzb['size'] and preferred_quality.get('size_max') < nzb['size']: + log.info('"%s" is too large to be %s. %sMB instead of the maximum of %sMB.' % (nzb['name'], preferred_quality['label'], nzb['size'], preferred_quality['size_max'])) return False - """ if imdb_results: return True