Browse Source

Simplify string before checking on imdb

tags/build/2.2.0
Ruud 12 years ago
parent
commit
eeeb845ef3
  1. 5
      couchpotato/core/helpers/variable.py
  2. 4
      couchpotato/core/plugins/scanner/main.py

5
couchpotato/core/helpers/variable.py

@ -123,8 +123,11 @@ def cleanHost(host):
return host return host
def getImdb(txt, check_inside = True, multiple = False): def getImdb(txt, check_inside = False, multiple = False):
if not check_inside:
txt = simplifyString(txt)
else:
txt = ss(txt) txt = ss(txt)
if check_inside and os.path.isfile(txt): if check_inside and os.path.isfile(txt):

4
couchpotato/core/plugins/scanner/main.py

@ -565,7 +565,7 @@ class Scanner(Plugin):
if not imdb_id: if not imdb_id:
try: try:
for nf in files['nfo']: for nf in files['nfo']:
imdb_id = getImdb(nf) imdb_id = getImdb(nf, check_inside = True)
if imdb_id: if imdb_id:
log.debug('Found movie via nfo file: %s', nf) log.debug('Found movie via nfo file: %s', nf)
nfo_file = nf nfo_file = nf
@ -578,7 +578,7 @@ class Scanner(Plugin):
try: try:
for filetype in files: for filetype in files:
for filetype_file in files[filetype]: for filetype_file in files[filetype]:
imdb_id = getImdb(filetype_file, check_inside = False) imdb_id = getImdb(filetype_file)
if imdb_id: if imdb_id:
log.debug('Found movie via imdb in filename: %s', nfo_file) log.debug('Found movie via imdb in filename: %s', nfo_file)
break break

Loading…
Cancel
Save