Standardized checking snatched

This commit is contained in:
Ruud
2012-09-28 13:10:58 +02:00
parent 151b100573
commit ce0bf7b51a
5 changed files with 169 additions and 156 deletions
+10 -2
View File
@@ -118,8 +118,16 @@ def getTitle(library_dict):
try:
return library_dict['titles'][0]['title']
except:
log.error('Could not get title for %s', library_dict['identifier'])
return None
try:
for title in library_dict.titles:
if title.default:
return title.title
except:
log.error('Could not get title for %s', library_dict.identifier)
return None
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