Only add rating if available

This commit is contained in:
Ruud committed 2014-03-21 21:51:00 +01:00
1 parent 0978ac33bc
commit b13b32952f
1 file changed
+4 -3
@@ -259,15 +259,16 @@ class TheTVDb(ShowProvider):
'released': get('firstaired'), 'released': get('firstaired'),
'runtime': get('runtime'), 'runtime': get('runtime'),
'contentrating': get('contentrating'), 'contentrating': get('contentrating'),
'rating': { 'rating': {},
'thetvdb': [tryFloat(get('rating')), tryInt(get('ratingcount'))],
},
'actors': splitString(get('actors'), '|'), 'actors': splitString(get('actors'), '|'),
'lastupdated': get('lastupdated'), 'lastupdated': get('lastupdated'),
'status': get('status'), 'status': get('status'),
'language': get('language'), 'language': get('language'),
} }
if tryFloat(get('rating')):
show_data['rating']['thetvdb'] = [tryFloat(get('rating')), tryInt(get('ratingcount'))],
show_data = dict((k, v) for k, v in show_data.iteritems() if v) show_data = dict((k, v) for k, v in show_data.iteritems() if v)
# Parse season and episode data # Parse season and episode data