Skip to content

Commit 7e69799

Browse files
committed
Loosen up date match logic in tvmaze.py
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
1 parent de9c759 commit 7e69799

File tree

1 file changed

+11
-0
lines changed
  • mythtv/programs/scripts/metadata/Television

1 file changed

+11
-0
lines changed

mythtv/programs/scripts/metadata/Television/tvmaze.py

+11
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,17 @@ def buildNumbers(args, opts):
421421
if opts.debug:
422422
print('Adding rebroadcast episode \'%s\' to date match list' % ep)
423423
date_match_list.append(i)
424+
# If there is only one episode of this show on this day,
425+
# consider it a date match.
426+
elif len(episodes) == 1:
427+
if opts.debug:
428+
if epInTgtZone > dtInTgtZone:
429+
print('Adding episode \'%s\' to date match list. Offset = %s' \
430+
% (episodes[i], epInTgtZone - dtInTgtZone))
431+
else:
432+
print('Adding episode \'%s\' to date match list. Offset = %s' \
433+
% (episodes[i], dtInTgtZone - epInTgtZone))
434+
date_match_list.append(i)
424435

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

0 commit comments

Comments
 (0)