Code cleanup

This commit is contained in:
Ruud
2013-09-02 21:59:06 +02:00
parent 7d32a8750d
commit 7fd14e0283
59 changed files with 171 additions and 170 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ class Score(Plugin):
addEvent('score.calculate', self.calculate)
def calculate(self, nzb, movie):
''' Calculate the score of a NZB, used for sorting later '''
""" Calculate the score of a NZB, used for sorting later """
# Merge global and category
preferred_words = splitString(Env.setting('preferred_words', section = 'searcher').lower())
+4 -4
View File
@@ -1,6 +1,6 @@
from couchpotato.core.event import fireEvent
from couchpotato.core.helpers.encoding import simplifyString
from couchpotato.core.helpers.variable import tryInt, splitString
from couchpotato.core.helpers.variable import tryInt
from couchpotato.environment import Env
import re
@@ -24,7 +24,7 @@ name_scores = [
def nameScore(name, year, preferred_words):
''' Calculate score for words in the NZB name '''
""" Calculate score for words in the NZB name """
score = 0
name = name.lower()
@@ -34,11 +34,11 @@ def nameScore(name, year, preferred_words):
v = value.split(':')
add = int(v.pop())
if v.pop() in name:
score = score + add
score += add
# points if the year is correct
if str(year) in name:
score = score + 5
score += 5
# Contains preferred word
nzb_words = re.split('\W+', simplifyString(name))