diff options
Diffstat (limited to 'server/cmd')
| -rw-r--r-- | server/cmd/listend/main.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/server/cmd/listend/main.go b/server/cmd/listend/main.go index 6a76f08..a98e01f 100644 --- a/server/cmd/listend/main.go +++ b/server/cmd/listend/main.go @@ -566,6 +566,10 @@ func (w *worker) rederiveAds() { continue } found := w.adsIn(e, held.Cues) + // Publishing is decided every time, even when the candidates have not moved: what + // is fit to act on is a separate judgement from what was found, and it changes on + // its own. Only the file is left alone when nothing moved. + w.publishWordBreaks(e, found) if sameCandidates(found, held.Ads) { continue } @@ -574,13 +578,20 @@ func (w *worker) rederiveAds() { log.Printf("re-deriving %q: %v", e.Title, err) continue } - w.publishWordBreaks(e, found) changed++ } } - if changed > 0 { - log.Printf("re-derived the advertising in %d stored transcript(s)", changed) + published, breaks := 0, 0 + for _, show := range w.state.Shows() { + for _, e := range show.Episodes { + if len(e.WordBreaks) > 0 { + published++ + breaks += len(e.WordBreaks) + } + } } + log.Printf("re-derived the advertising in %d stored transcript(s); "+ + "%d episode(s) publish %d break(s) found in their words", changed, published, breaks) } func sameCandidates(left, right []transcript.Candidate) bool { |
