Extra check for imdb file. close #273
This commit is contained in:
1 parent
b59861c22a
commit
63f46fae75
2 files changed
+13
-3
No files matched your search
@@ -77,9 +77,9 @@ def cleanHost(host):
|
|||||||
|
|
||||||
return host
|
return host
|
||||||
|
|
||||||
def getImdb(txt):
|
def getImdb(txt, check_inside = True):
|
||||||
|
|
||||||
if os.path.isfile(txt):
|
if check_inside and os.path.isfile(txt):
|
||||||
output = open(txt, 'r')
|
output = open(txt, 'r')
|
||||||
txt = output.read()
|
txt = output.read()
|
||||||
output.close()
|
output.close()
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ class Scanner(Plugin):
|
|||||||
log.debug('Found movie via CP tag: %s' % cur_file)
|
log.debug('Found movie via CP tag: %s' % cur_file)
|
||||||
break
|
break
|
||||||
|
|
||||||
# Check and see if nfo contains the imdb-id
|
# Check and see if nfo or filenames contains the imdb-id
|
||||||
if not imdb_id:
|
if not imdb_id:
|
||||||
try:
|
try:
|
||||||
for nfo_file in files['nfo']:
|
for nfo_file in files['nfo']:
|
||||||
@@ -454,6 +454,16 @@ class Scanner(Plugin):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
for filetype in files:
|
||||||
|
for filetype_file in files[filetype]:
|
||||||
|
imdb_id = getImdb(filetype_file, check_inside = False)
|
||||||
|
if imdb_id:
|
||||||
|
log.debug('Found movie via imdb in filename: %s' % nfo_file)
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# Check if path is already in db
|
# Check if path is already in db
|
||||||
if not imdb_id:
|
if not imdb_id:
|
||||||
db = get_session()
|
db = get_session()
|
||||||
|
|||||||
Reference in new issue
Block a user