From b13b32952f78b1e500368915c36c476bc16e68bf Mon Sep 17 00:00:00 2001 From: Ruud Date: Fri, 21 Mar 2014 21:51:00 +0100 Subject: [PATCH] Only add rating if available --- couchpotato/core/media/show/providers/info/thetvdb.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/couchpotato/core/media/show/providers/info/thetvdb.py b/couchpotato/core/media/show/providers/info/thetvdb.py index d221ce57..706fff94 100644 --- a/couchpotato/core/media/show/providers/info/thetvdb.py +++ b/couchpotato/core/media/show/providers/info/thetvdb.py @@ -259,15 +259,16 @@ class TheTVDb(ShowProvider): 'released': get('firstaired'), 'runtime': get('runtime'), 'contentrating': get('contentrating'), - 'rating': { - 'thetvdb': [tryFloat(get('rating')), tryInt(get('ratingcount'))], - }, + 'rating': {}, 'actors': splitString(get('actors'), '|'), 'lastupdated': get('lastupdated'), 'status': get('status'), '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) # Parse season and episode data