diff options
Diffstat (limited to 'server/cmd')
| -rw-r--r-- | server/cmd/listend/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/cmd/listend/main.go b/server/cmd/listend/main.go index d45f890..100eae5 100644 --- a/server/cmd/listend/main.go +++ b/server/cmd/listend/main.go @@ -544,7 +544,12 @@ advertisement. func (w *worker) adsIn(e *store.Episode, cues []transcript.Cue) []transcript.Candidate { if e.MasterCues > 0 { if master, err := w.transcripts.Master(e.ID); err == nil { - if found := transcript.Inserted(master.Cues, cues); len(found) > 0 { + // Trimmed as well as found: subtraction answers "not in the master", which takes + // in the last line of the programme whenever recognition dented it enough to stop + // it matching. See transcript.Trimmed. + if found := transcript.Trimmed( + transcript.Inserted(master.Cues, cues), master.Cues, cues, + ); len(found) > 0 { return found } } |
