From da669703b1a8c8ed965a4a32e481fb4f7fa86cb2 Mon Sep 17 00:00:00 2001 From: Prinz23 Date: Mon, 21 Aug 2023 19:12:46 +0200 Subject: [PATCH] Fix banner url validation for TheTVDb api v3 lib. --- CHANGES.md | 1 + lib/api_tvdb/tvdb_api.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3131b947..b59e20a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ * Fix regex that was not using py312 notation * Change sort backlog and manual segment search results episode number * Change sort episodes when set to wanted on display show page +* Fix banner url validation for TheTVDb api v3 lib ### 3.29.4 (2023-06-07 13:45:00 UTC) diff --git a/lib/api_tvdb/tvdb_api.py b/lib/api_tvdb/tvdb_api.py index b90f3a44..ffd5bb24 100644 --- a/lib/api_tvdb/tvdb_api.py +++ b/lib/api_tvdb/tvdb_api.py @@ -518,7 +518,8 @@ class Tvdb(TVInfoBase): if None is not v: if k in ['banner', 'fanart', 'poster', 'image'] and v: v = (self.config['url_artworks'], - self.config['url_artworks_search'])['banners/' in v] % v.lstrip('/') + self.config['url_artworks_search'])[ + isinstance(v, string_types) and v.lstrip('/').startswith('banners/')] % v.lstrip('/') elif 'genre' == k: keep_data['genre_list'] = v v = '|'.join([clean_data(c) for c in v if isinstance(c, string_types)])