Skip to content

Conversation

@SteveErl
Copy link
Contributor

Sometimes, the TvMaze database only specifies a date and not a time for an episode or set of episodes. This is most common in webChannel originated shows. In such a case, the 'Find Episode by Timestamp' syntax usually fails to find an exact or close match.
For example:
tvmaze.py -N "Criminal Minds" "2022-11-24 21:00:00"

For this episode, in the TvMaze database

   airtime =
   airdate = 2022-11-24

In this code update, we detect when no airtime is specified in the database, and apply a match-by-date behavior.

The match-by-date results are only used as a last resort. First we select exact timestamp matches. If there are none of those, we select close timestamp matches. If there are none of those, then we'll select date only matches.

For example:

tvmaze.py -N "Criminal Minds" "2022-11-24 21:00:00"
<?xml version='1.0' encoding='UTF-8'?>
<metadata>
  <item>
    <title>Criminal Minds</title>
    <subtitle>Just Getting Started</subtitle>
    ...
    <season>16</season>
    <episode>1</episode>
    <inetref>81</inetref>
    ...
  </item>
  <item>
    <title>Criminal Minds</title>
    <subtitle>Sicarius</subtitle>
    ...
    <season>16</season>
    <episode>2</episode>
    <inetref>81</inetref>
    ...
  </item>
</metadata>

Note that there were 2 episodes released on 2022-11-24, so both episodes match-by-date and appear in the above results.

In addition, a display of runtime has been added for the -M invocation option. For example

tvmaze.py -M "Fire Country"
<?xml version='1.0' encoding='UTF-8'?>
<metadata>
  <item>
    <title>Fire Country</title>
    ...
    <inetref>60339</inetref>
    <collectionref>60339</collectionref>
    <language>en</language>
    <releasedate>2022-10-07</releasedate>
    <userrating>6.300000</userrating>
    <popularity>99.0</popularity>
    <year>2022</year>
    <runtime>60</runtime>
    ...
  </item>
</metadata>

Resolves #654

Checklist

Sometimes, the TvMaze database only specifies a date
and not a time for an episode or set of episodes.
This is most common in webChannel originated shows.
In such a case, the 'Find Episode by Timestamp'
syntax, fails to find an exact or close match.
For example:
   tvmaze.py -N "Criminal Minds" "2022-11-24 21:00:00"

For this episode, in the TvMaze database
        airtime =
        airdate = 2022-11-24

With this code update, we detect when no airtime is
specified in the database, and apply a match-by-date
behavior.

The match-by-date results are only used as a last
resort. First we select exact timestamp matches.
If there are none of those, we select close
timestamp matches. If there are none of those,
then we'll select date only matches.

For example:

tvmaze.py -N "Criminal Minds" "2022-11-24 21:00:00"
<?xml version='1.0' encoding='UTF-8'?>
<metadata>
  <item>
    <title>Criminal Minds</title>
    <subtitle>Just Getting Started</subtitle>
    ...
    <season>16</season>
    <episode>1</episode>
    <inetref>81</inetref>
    ...
  </item>
  <item>
    <title>Criminal Minds</title>
    <subtitle>Sicarius</subtitle>
    ...
    <season>16</season>
    <episode>2</episode>
    <inetref>81</inetref>
    ...
  </item>
</metadata>

Note that there were 2 episodes released on 2022-11-24,
so both episodes appear in the output results.

In addition, a display of 'runtime' has been added
for the -M invocation option. For example

tvmaze.py -M "Fire Country"
<?xml version='1.0' encoding='UTF-8'?>
<metadata>
  <item>
    <title>Fire Country</title>
    ...
    <inetref>60339</inetref>
    <collectionref>60339</collectionref>
    <language>en</language>
    <releasedate>2022-10-07</releasedate>
    <userrating>6.300000</userrating>
    <popularity>99.0</popularity>
    <year>2022</year>
    <runtime>60</runtime>
    ...
  </item>
</metadata>

Resolves MythTV#654
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tvmaze metadata lookup failures

1 participant