[mythtv-commits] [MythTV/mythtv] c206d1: Fix setting of TvMaze show runtime

Steve Erlenborn noreply at github.com
Sun Jan 22 20:37:02 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/MythTV/mythtv
  Commit: c206d17762063f47062900aa6daf77dd9b367da5
      https://github.com/MythTV/mythtv/commit/c206d17762063f47062900aa6daf77dd9b367da5
  Author: Steve Erlenborn <1751095+SteveErl at users.noreply.github.com>
  Date:   2023-01-22 (Sun, 22 Jan 2023)

  Changed paths:
    M mythtv/bindings/python/tvmaze/show.py
    M mythtv/programs/scripts/metadata/Television/tvmaze.py

  Log Message:
  -----------
  Fix setting of TvMaze show runtime

The script tvmaze/show.py had a line which retrieved the episode
duration from the metadata provider, but then assigned it to
num_episodes, which makes no sense. There is no code looking for
num_episodes, but there is code looking for runtime, so the line
has been fixed to assign to runtime.

Using the TVmaze service for metadata lookup, there are rare
cases where the 'runtime' field is empty, but 'averageRuntime'
is not. This happened when looking up metadata for a TV show
called "Everything's Trash". Note that the database entry for
this show was subsequently updated to include the missing
'runtime' field. But on the night it was recorded, and for
several days later, that field was null.

Here's an excerpt of the original metadata for "Everything's Trash":

"id":60518,
"url":"https://www.tvmaze.com/shows/60518/everythings-trash",
"name":"Everything's Trash",
"type":"Scripted",
"language":"English",
"genres":[],
"status":"Running",
"runtime":null,
"averageRuntime":30,

To handle this type of scenario, when the 'runtime' field is null,
read the duration from the 'averageRuntime' field. If both are null,
then avoid trying to cast that value to an integer in tvmaze.py.

Refs: #654


  Commit: f4df2fbefd9c8614c5a6fd14a4c938597b48a26b
      https://github.com/MythTV/mythtv/commit/f4df2fbefd9c8614c5a6fd14a4c938597b48a26b
  Author: Steve Erlenborn <1751095+SteveErl at users.noreply.github.com>
  Date:   2023-01-22 (Sun, 22 Jan 2023)

  Changed paths:
    M mythtv/programs/scripts/metadata/Television/tvmaze.py

  Log Message:
  -----------
  Add missing runtime to tvmaze collection display

When using tvmaze.py to retrieve Collection information, the
runtime information was not being displayed. This update adds
it to output. For example, the Collection information for
the TV show "Hogan's Heroes" is now:

/usr/share/mythtv/metadata/Television/tvmaze.py -C 1475
<?xml version='1.0' encoding='UTF-8'?>
<metadata>
  <item>
    <title>Hogan's Heroes</title>
...
    <inetref>1475</inetref>
    <imdb>tt0058812</imdb>
    <collectionref>1475</collectionref>
    <language>en</language>
    <releasedate>1965-09-17</releasedate>
    <userrating>8.000000</userrating>
    <popularity>85.0</popularity>
    <year>1965</year>
    <runtime>30</runtime>
...
  </item>
</metadata>

Refs: #654


Compare: https://github.com/MythTV/mythtv/compare/5be6bdaae28c...f4df2fbefd9c


More information about the mythtv-commits mailing list