Added "library.root" event, fixes to "matcher", "release" and "score" to use "library.root" + handle missing "year"

This commit is contained in:
Dean Gardiner
2014-07-25 11:58:27 +12:00
parent 4efdca91d5
commit 050d8ccfda
5 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ class Score(Plugin):
try: preferred_words = removeDuplicate(preferred_words + splitString(movie['category']['preferred'].lower()))
except: pass
score = nameScore(toUnicode(nzb['name']), movie['info']['year'], preferred_words)
score = nameScore(toUnicode(nzb['name']), movie['info'].get('year'), preferred_words)
for movie_title in movie['info']['titles']:
score += nameRatioScore(toUnicode(nzb['name']), toUnicode(movie_title))
+1 -1
View File
@@ -44,7 +44,7 @@ def nameScore(name, year, preferred_words):
score += add
# points if the year is correct
if str(year) in name:
if year and str(year) in name:
score += 5
# Contains preferred word