From afdd3e3395958079a209c5103c8d2c28035492ba Mon Sep 17 00:00:00 2001 From: Ruud Date: Sat, 14 Jan 2012 14:06:33 +0100 Subject: [PATCH] Add score penalty for not having proper size information --- couchpotato/core/plugins/score/main.py | 5 ++++- couchpotato/core/plugins/score/scores.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/score/main.py b/couchpotato/core/plugins/score/main.py index 1dd847e3..24c2997a 100644 --- a/couchpotato/core/plugins/score/main.py +++ b/couchpotato/core/plugins/score/main.py @@ -1,7 +1,8 @@ from couchpotato.core.event import addEvent from couchpotato.core.logger import CPLog from couchpotato.core.plugins.base import Plugin -from couchpotato.core.plugins.score.scores import nameScore, nameRatioScore +from couchpotato.core.plugins.score.scores import nameScore, nameRatioScore, \ + sizeScore log = CPLog(__name__) @@ -19,4 +20,6 @@ class Score(Plugin): for movie_title in movie['library']['titles']: score += nameRatioScore(nzb['name'], movie_title['title']) + score += sizeScore(nzb['size']) + return score diff --git a/couchpotato/core/plugins/score/scores.py b/couchpotato/core/plugins/score/scores.py index 4f5192f1..4ee0511f 100644 --- a/couchpotato/core/plugins/score/scores.py +++ b/couchpotato/core/plugins/score/scores.py @@ -52,3 +52,7 @@ def nameRatioScore(nzb_name, movie_name): left_over = set(nzb_words) - set(movie_words) return 10 - len(left_over) + + +def sizeScore(size): + return 0 if size else -20