Skip to content

Commit

Permalink
Revert "When a TvMaze episode runtime field is missing, try using ave…
Browse files Browse the repository at this point in the history
…rageRuntime field. If both are missing, avoid a crash by testing for a non-NULL episode duration. MythTV#654"

This reverts commit 82bad85.

I've learned that I cannot push more than one commit from one branch.
  • Loading branch information
SteveErl committed Nov 9, 2022
1 parent 82bad85 commit 84f6f4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions mythtv/bindings/python/tvmaze/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ def __init__(self, data):
self.language = show.get('language')
self.genres = show.get('genres')
self.status = show.get('status')
self.runtime = show.get('runtime')
# Sometimes runtime is empty, but averageRuntime is not
if self.runtime is None:
self.runtime = show.get('averageRuntime')
self.num_episodes = show.get('runtime')
self.seasons = {}
self._episode_list = []
self.specials = {}
Expand Down
3 changes: 1 addition & 2 deletions mythtv/programs/scripts/metadata/Television/tvmaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,7 @@ 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))
if ep_info.duration:
m.runtime = check_item(m, ("runtime", int(ep_info.duration)))
m.runtime = check_item(m, ("runtime", int(ep_info.duration)))

for actor in show_info.cast:
try:
Expand Down

0 comments on commit 84f6f4e

Please sign in to comment.