diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-10-30 08:42:51 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-10-30 08:42:51 +0000 |
| commit | 3946d650538033efd51c0b3faf9d08fb534ec2ae (patch) | |
| tree | 6faf837ffc17785303fd7ca98c9bc424d2f84def /server/cmd | |
| parent | d7da85860bde910a182df2fc65ce284750272a78 (diff) | |
Decide publishing every time, not only when the candidates moved
The re-derive pass skipped an episode whose advertising had not changed since
last time, which is sensible for rewriting the file and wrong for everything
else: what is *fit to act on* is a separate judgement from what was found, and
it changes on its own -- it just did, when publishing was added.
So the eighteen episodes that had been measured for days published nothing,
because their candidates were already correct. Found by looking at the state
file after deploying rather than by assuming the deploy had worked.
The readout now says how many episodes publish how many breaks, every start, so
"nothing changed" and "nothing is published" can no longer look alike.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
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 { |
