diff --git a/mythtv/bindings/python/tvmaze/show.py b/mythtv/bindings/python/tvmaze/show.py index 194d362107e..9e07af70432 100644 --- a/mythtv/bindings/python/tvmaze/show.py +++ b/mythtv/bindings/python/tvmaze/show.py @@ -47,7 +47,10 @@ def __init__(self, data): self.language = show.get('language') self.genres = show.get('genres') self.status = show.get('status') - self.num_episodes = show.get('runtime') + self.runtime = show.get('runtime') + # Sometimes runtime is empty, but averageRuntime is not + if self.runtime is None: + self.runtime = show.get('averageRuntime') self.seasons = {} self._episode_list = [] self.specials = {} diff --git a/mythtv/programs/scripts/metadata/Television/tvmaze.py b/mythtv/programs/scripts/metadata/Television/tvmaze.py index 4a7e7c5f945..a4c9ea416c3 100755 --- a/mythtv/programs/scripts/metadata/Television/tvmaze.py +++ b/mythtv/programs/scripts/metadata/Television/tvmaze.py @@ -442,7 +442,8 @@ def buildSingleItem(inetref, season, episode_id): elif show_info.premiere_date: m.releasedate = check_item(m, ("releasedate", show_info.premiere_date)) m.year = check_item(m, ("year", show_info.premiere_date.year)) - m.runtime = check_item(m, ("runtime", int(ep_info.duration))) + if ep_info.duration: + m.runtime = check_item(m, ("runtime", int(ep_info.duration))) for actor in show_info.cast: try: