diff --git a/CHANGES.md b/CHANGES.md index 715b4344..a784afc0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,11 @@ * Refactor `timestamp_near` to `SGDatetime.timestamp_near` +### 3.27.12 (2023-03-08 23:30:00 UTC) + +* Change meta providers to new TVInfoAPI get_show to make sure language is used + + ### 3.27.11 (2023-03-06 23:40:00 UTC) * Fix "Change File Date" not using timestamp of episode if available diff --git a/sickgear/metadata/generic.py b/sickgear/metadata/generic.py index 00c971ef..33cd8e1c 100644 --- a/sickgear/metadata/generic.py +++ b/sickgear/metadata/generic.py @@ -509,7 +509,8 @@ class GenericMetadata(object): t = sickgear.TVInfoAPI(TVINFO_TVDB).setup(**tvinfo_config) - ep_info = t[cur_ep_obj.show_obj.prodid][cur_ep_obj.season][cur_ep_obj.episode] + ep_info = t.get_show(cur_ep_obj.show_obj.prodid, language=show_lang)[ + cur_ep_obj.season][cur_ep_obj.episode] except (BaseTVinfoEpisodenotfound, BaseTVinfoSeasonnotfound, TypeError): ep_info = None else: @@ -1079,7 +1080,7 @@ class GenericMetadata(object): tvinfo_config['language'] = show_obj.lang t = sickgear.TVInfoAPI(show_obj.tvid).setup(**tvinfo_config) - tvinfo_obj_show = t[show_obj.prodid] + tvinfo_obj_show = t.get_show(show_obj.prodid, language=show_obj.lang) except (BaseTVinfoError, IOError) as e: logger.warning(f'Unable to look up show on {sickgear.TVInfoAPI(show_obj.tvid).name},' f' not downloading images: {ex(e)}') diff --git a/sickgear/metadata/kodi.py b/sickgear/metadata/kodi.py index 5b836ad4..f0787a36 100644 --- a/sickgear/metadata/kodi.py +++ b/sickgear/metadata/kodi.py @@ -125,7 +125,7 @@ class KODIMetadata(generic.GenericMetadata): tv_node = etree.Element('tvshow') try: - show_info = t[int(show_id)] + show_info = t.get_show(show_obj.prodid, language=show_obj.lang) except BaseTVinfoShownotfound as e: logger.error(f'Unable to find show with id {show_id} on {sickgear.TVInfoAPI(show_obj.tvid).name},' f' skipping it') @@ -286,7 +286,7 @@ class KODIMetadata(generic.GenericMetadata): try: t = sickgear.TVInfoAPI(ep_obj.show_obj.tvid).setup(**tvinfo_config) - show_info = t[ep_obj.show_obj.prodid] + show_info = t.get_show(ep_obj.show_obj.prodid, language=ep_obj.show_obj.lang) except BaseTVinfoShownotfound as e: raise exceptions_helper.ShowNotFoundException(ex(e)) except BaseTVinfoError as e: diff --git a/sickgear/metadata/mede8er.py b/sickgear/metadata/mede8er.py index b9f996f5..62c0ec9b 100644 --- a/sickgear/metadata/mede8er.py +++ b/sickgear/metadata/mede8er.py @@ -125,7 +125,7 @@ class Mede8erMetadata(mediabrowser.MediaBrowserMetadata): tv_node.attrib['isTV'] = 'true' try: - show_info = t[int(show_obj.prodid)] + show_info = t.get_show(show_obj.prodid, language=show_obj.lang) except BaseTVinfoShownotfound as e: logger.error(f'Unable to find show with id {show_obj.prodid} on tvdb, skipping it') raise e @@ -237,7 +237,7 @@ class Mede8erMetadata(mediabrowser.MediaBrowserMetadata): tvinfo_config['dvdorder'] = True t = sickgear.TVInfoAPI(ep_obj.show_obj.tvid).setup(**tvinfo_config) - show_info = t[ep_obj.show_obj.prodid] + show_info = t.get_show(ep_obj.show_obj.prodid, language=ep_obj.show_obj.lang) except BaseTVinfoShownotfound as e: raise exceptions_helper.ShowNotFoundException(ex(e)) except BaseTVinfoError as e: diff --git a/sickgear/metadata/mediabrowser.py b/sickgear/metadata/mediabrowser.py index f8c1e8d3..5ae2cd60 100644 --- a/sickgear/metadata/mediabrowser.py +++ b/sickgear/metadata/mediabrowser.py @@ -250,7 +250,7 @@ class MediaBrowserMetadata(generic.GenericMetadata): tv_node = etree.Element("Series") try: - show_info = t[int(show_obj.prodid)] + show_info = t.get_show(show_obj.prodid, language=show_obj.lang) except BaseTVinfoShownotfound as e: logger.error(f'Unable to find show with id {show_obj.prodid} ' f'on {sickgear.TVInfoAPI(show_obj.tvid).name}, skipping it') @@ -410,7 +410,7 @@ class MediaBrowserMetadata(generic.GenericMetadata): t = sickgear.TVInfoAPI(ep_obj.show_obj.tvid).setup(**tvinfo_config) - show_info = t[ep_obj.show_obj.prodid] + show_info = t.get_show(ep_obj.show_obj.prodid, language=ep_obj.show_obj.lang) except BaseTVinfoShownotfound as e: raise exceptions_helper.ShowNotFoundException(ex(e)) except BaseTVinfoError as e: diff --git a/sickgear/metadata/tivo.py b/sickgear/metadata/tivo.py index b3a040d3..9d749bee 100644 --- a/sickgear/metadata/tivo.py +++ b/sickgear/metadata/tivo.py @@ -199,7 +199,7 @@ class TIVOMetadata(generic.GenericMetadata): tvinfo_config['dvdorder'] = True t = sickgear.TVInfoAPI(ep_obj.show_obj.tvid).setup(**tvinfo_config) - show_info = t[ep_obj.show_obj.prodid] + show_info = t.get_show(ep_obj.show_obj.prodid, language=ep_obj.show_obj.lang) except BaseTVinfoShownotfound as e: raise exceptions_helper.ShowNotFoundException(ex(e)) except BaseTVinfoError as e: diff --git a/sickgear/metadata/wdtv.py b/sickgear/metadata/wdtv.py index 9dda6a5d..b0c87c92 100644 --- a/sickgear/metadata/wdtv.py +++ b/sickgear/metadata/wdtv.py @@ -200,7 +200,7 @@ class WDTVMetadata(generic.GenericMetadata): tvinfo_config['dvdorder'] = True t = sickgear.TVInfoAPI(ep_obj.show_obj.tvid).setup(**tvinfo_config) - show_info = t[ep_obj.show_obj.prodid] + show_info = t.get_show(ep_obj.show_obj.prodid, language=ep_obj.show_obj.lang) except BaseTVinfoShownotfound as e: raise exceptions_helper.ShowNotFoundException(ex(e)) except BaseTVinfoError as e: diff --git a/sickgear/metadata/xbmc_12plus.py b/sickgear/metadata/xbmc_12plus.py index 57b0f2de..2721d291 100644 --- a/sickgear/metadata/xbmc_12plus.py +++ b/sickgear/metadata/xbmc_12plus.py @@ -121,7 +121,7 @@ class XBMC12PlusMetadata(generic.GenericMetadata): tv_node = etree.Element('tvshow') try: - show_info = t[int(show_id)] + show_info = t.get_show(show_id, language=show_lang) except BaseTVinfoShownotfound as e: logger.error(f'Unable to find show with id {show_id} on {sickgear.TVInfoAPI(show_obj.tvid).name},' f' skipping it') @@ -222,7 +222,7 @@ class XBMC12PlusMetadata(generic.GenericMetadata): try: t = sickgear.TVInfoAPI(ep_obj.show_obj.tvid).setup(**tvinfo_config) - show_info = t[ep_obj.show_obj.prodid] + show_info = t.get_show(ep_obj.show_obj.prodid, language=ep_obj.show_obj.lang) except BaseTVinfoShownotfound as e: raise exceptions_helper.ShowNotFoundException(ex(e)) except BaseTVinfoError as e: