Fix IMDb links to older shows on displayShow and editShow.

This commit is contained in:
JackDandy 2018-05-01 13:20:24 +01:00
parent 603b8d57b4
commit 26fd782b79
2 changed files with 16 additions and 1 deletions

View file

@ -1,4 +1,9 @@
### 0.16.0 (2018-04-26 17:10:00 UTC) ### 0.16.1 (2018-05-01 13:20:00 UTC)
* Fix IMDb links to older shows on displayshow and editshow page
### 0.16.0 (2018-04-26 17:10:00 UTC)
* Change search show result 'exists in db' text into a link to display show page * Change search show result 'exists in db' text into a link to display show page
* Change increase namecache size and fix deleting items from it when at capacity * Change increase namecache size and fix deleting items from it when at capacity

View file

@ -1719,6 +1719,14 @@ class Home(MainHandler):
return json.dumps({'success': t.respond()}) return json.dumps({'success': t.respond()})
@staticmethod
def fix_imdb_id(obj):
try:
obj.ids[sickbeard.indexers.indexer_config.INDEXER_IMDB]['id'] = '%07d' % obj.ids[
sickbeard.indexers.indexer_config.INDEXER_IMDB]['id']
except (StandardError, Exception):
pass
def displayShow(self, show=None): def displayShow(self, show=None):
if show is None: if show is None:
@ -1794,6 +1802,7 @@ class Home(MainHandler):
{'title': 'Download Subtitles', 'path': 'home/subtitleShow?show=%d' % showObj.indexerid}) {'title': 'Download Subtitles', 'path': 'home/subtitleShow?show=%d' % showObj.indexerid})
t.show = showObj t.show = showObj
self.fix_imdb_id(t.show)
with BS4Parser('<html><body>%s</body></html>' % showObj.overview, features=['html5lib', 'permissive']) as soup: with BS4Parser('<html><body>%s</body></html>' % showObj.overview, features=['html5lib', 'permissive']) as soup:
try: try:
soup.a.replace_with(soup.new_tag('')) soup.a.replace_with(soup.new_tag(''))
@ -2224,6 +2233,7 @@ class Home(MainHandler):
with showObj.lock: with showObj.lock:
t.show = showObj t.show = showObj
self.fix_imdb_id(t.show)
t.show_has_scene_map = showObj.indexerid in sickbeard.scene_exceptions.xem_ids_list[showObj.indexer] t.show_has_scene_map = showObj.indexerid in sickbeard.scene_exceptions.xem_ids_list[showObj.indexer]
# noinspection PyTypeChecker # noinspection PyTypeChecker