More nosql

This commit is contained in:
Ruud
2014-02-02 20:41:14 +01:00
parent 63743dd2b6
commit 99252074be
82 changed files with 643 additions and 715 deletions
+7 -9
View File
@@ -216,26 +216,24 @@ def toIterable(value):
return [value]
def getTitle(library_dict):
def getTitle(media_dict):
try:
try:
return library_dict['titles'][0]['title']
return media_dict['title']
except:
try:
for title in library_dict.titles:
if title.default:
return title.title
return media_dict['titles'][0]
except:
try:
return library_dict['info']['titles'][0]
return media_dict['info']['titles'][0]
except:
log.error('Could not get title for %s', library_dict.identifier)
log.error('Could not get title for %s', media_dict.get('identifier'))
return None
log.error('Could not get title for %s', library_dict['identifier'])
log.error('Could not get title for %s', media_dict['identifier'])
return None
except:
log.error('Could not get title for library item: %s', library_dict)
log.error('Could not get title for library item: %s', media_dict)
return None