From 13af7437af2b5555f6e547dcb428abcb9ee014a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Thu, 21 Oct 2021 15:19:10 +0200 Subject: [PATCH] Various fixes due to layout changes (#97) * Various fixes due to layout changes * Update .pylintrc --- .pylintrc | 1 + resources/lib/modules/catalog.py | 5 +++-- resources/lib/viervijfzes/content.py | 2 +- tests/test_api.py | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 59f9258..248d282 100644 --- a/.pylintrc +++ b/.pylintrc @@ -21,3 +21,4 @@ disable= super-with-arguments, # Python 2.7 compatibility raise-missing-from, # Python 2.7 compatibility + consider-using-f-string, # Python 2.7 compatibility diff --git a/resources/lib/modules/catalog.py b/resources/lib/modules/catalog.py index 66ca7da..46bb5f4 100644 --- a/resources/lib/modules/catalog.py +++ b/resources/lib/modules/catalog.py @@ -113,7 +113,7 @@ class Catalog: }, info_dict={ 'tvshowtitle': program.title, - 'title': kodiutils.localize(30205, season=season.number), # Season {season} + 'title': kodiutils.localize(30205, season=season.number) if season.number else season.title, # Season {season} 'plot': season.description or program.description, 'set': program.title, } @@ -243,7 +243,8 @@ class Catalog: listing = [] for episode in episodes: title_item = Menu.generate_titleitem(episode) - title_item.info_dict['title'] = episode.program_title + ' - ' + title_item.title + if episode.program_title: + title_item.info_dict['title'] = episode.program_title + ' - ' + title_item.title listing.append(title_item) for program in programs: diff --git a/resources/lib/viervijfzes/content.py b/resources/lib/viervijfzes/content.py index 246a304..23c4d9b 100644 --- a/resources/lib/viervijfzes/content.py +++ b/resources/lib/viervijfzes/content.py @@ -454,7 +454,7 @@ class ContentApi: # Categories regexes regex_articles = re.compile(r']+>(.*?)', re.DOTALL) - regex_category = re.compile(r'(.*?)(?:.*?
(.*?)
)?', re.DOTALL) + regex_category = re.compile(r'(.*?)(?:.*?
(.*?)
)?', re.DOTALL) categories = [] for result in regex_articles.finditer(raw_html): diff --git a/tests/test_api.py b/tests/test_api.py index 6561b61..381b790 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -75,7 +75,7 @@ class TestApi(unittest.TestCase): @unittest.skipUnless(kodiutils.get_setting('username') and kodiutils.get_setting('password'), 'Skipping since we have no credentials.') def test_get_drm_stream(self): - resolved_stream = self._api.get_stream_by_uuid('c6c67b09-8068-4121-8030-8708735f1429') # NCIS 18x10 + resolved_stream = self._api.get_stream_by_uuid('2a17b793-7407-42b2-9851-5487db6d3a6a') # NCIS LA 10x6 self.assertIsInstance(resolved_stream, ResolvedStream)