Skip to content

Commit

Permalink
Loosen up date match logic in tvmaze.py
Browse files Browse the repository at this point in the history
When running a match-by-timestamp in tvmaze.py,
if there is only one episode on the given date,
consider it a date match. This will help us get
precise metadata even if the timezone offset and
rebroadcast delay adjustments don't give us an
exact timing match.

Refs: MythTV#717
  • Loading branch information
SteveErl committed Mar 3, 2023
1 parent de9c759 commit 7e69799
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mythtv/programs/scripts/metadata/Television/tvmaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,17 @@ def buildNumbers(args, opts):
if opts.debug:
print('Adding rebroadcast episode \'%s\' to date match list' % ep)
date_match_list.append(i)
# If there is only one episode of this show on this day,
# consider it a date match.
elif len(episodes) == 1:
if opts.debug:
if epInTgtZone > dtInTgtZone:
print('Adding episode \'%s\' to date match list. Offset = %s' \
% (episodes[i], epInTgtZone - dtInTgtZone))
else:
print('Adding episode \'%s\' to date match list. Offset = %s' \
% (episodes[i], dtInTgtZone - epInTgtZone))
date_match_list.append(i)

if not time_match_list:
# No exact matches found, so use the list of the closest episode(s)
Expand Down

0 comments on commit 7e69799

Please sign in to comment.