Match by date when no time specified in TvMaze DB #701
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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:
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
Resolves #654
Checklist