Various fixes due to layout changes (#97)

* Various fixes due to layout changes

* Update .pylintrc
This commit is contained in:
Michaël Arnauts 2021-10-21 15:19:10 +02:00 committed by GitHub
parent e07edfa658
commit 13af7437af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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:

View File

@ -454,7 +454,7 @@ class ContentApi:
# Categories regexes
regex_articles = re.compile(r'<article[^>]+>(.*?)</article>', re.DOTALL)
regex_category = re.compile(r'<h1.*?>(.*?)</h1>(?:.*?<div class=\"visually-hidden\">(.*?)</div>)?', re.DOTALL)
regex_category = re.compile(r'<h2.*?>(.*?)</h2>(?:.*?<div class="visually-hidden">(.*?)</div>)?', re.DOTALL)
categories = []
for result in regex_articles.finditer(raw_html):

View File

@ -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)