From 44241a61a2224ea347e0b48292a4940266815888 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Tue, 1 Nov 2016 18:53:39 +0100 Subject: [PATCH] Fix TVDb search issue when only 1 result is returned. --- CHANGES.md | 1 + lib/tvdb_api/tvdb_api.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index b09541a7..ef79cb49 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -221,6 +221,7 @@ * Fix "error trying to retrieve image" from tvdb due to there is no image to fetch * Fix PiSexy for vip user class * Change retry sleep timeout for Trakt searches to prevent issues when Trakt is down +* Fix TVDb search issue when only 1 result is returned ### 0.11.16 (2016-10-16 17:30:00 UTC) diff --git a/lib/tvdb_api/tvdb_api.py b/lib/tvdb_api/tvdb_api.py index fbc70258..ea052565 100644 --- a/lib/tvdb_api/tvdb_api.py +++ b/lib/tvdb_api/tvdb_api.py @@ -649,6 +649,8 @@ class Tvdb: try: series_found = self._getetsrc(self.config['url_get_series'], self.config['params_get_series']) if series_found: + if not isinstance(series_found['Series'], list): + series_found['Series'] = [series_found['Series']] series_found['Series'] = [{k.lower(): v for k, v in s.iteritems()} for s in series_found['Series']] return series_found.values()[0] except: