Do some title testing. fix #246 closes #238

This commit is contained in:
Ruud
2012-05-11 22:59:47 +02:00
parent 369f08b00b
commit 4bdd23e36a
13 changed files with 48 additions and 25 deletions
+15
View File
@@ -1,8 +1,11 @@
from couchpotato.core.logger import CPLog
import hashlib
import os.path
import platform
import re
log = CPLog(__name__)
def getDataDir():
# Windows
@@ -102,3 +105,15 @@ def natsortKey(s):
def natcmp(a, b):
return cmp(natsortKey(a), natsortKey(b))
def getTitle(library_dict):
try:
try:
return library_dict['titles'][0]['title']
except:
log.error('Could not get title for %s' % library_dict['identifier'])
return None
except:
log.error('Could not get title for library item: %s' % library_dict)
return None