summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/cmd/listend/main.go22
1 files changed, 19 insertions, 3 deletions
diff --git a/server/cmd/listend/main.go b/server/cmd/listend/main.go
index c21d65a..6dd3c65 100644
--- a/server/cmd/listend/main.go
+++ b/server/cmd/listend/main.go
@@ -598,7 +598,19 @@ func adAccounting(e *store.Episode, found []transcript.Candidate) string {
}
}
-// pendingRecognition is every mirrored episode still without words, newest first.
+/*
+pendingRecognition is every mirrored episode still without words, best first.
+
+An episode holding the publisher's ad-free master comes first, whatever its date. Recognising
+one of those produces an answer that checks itself: subtraction found 4:20 of the 4:15 the
+lengths imply on Darknet Diaries and 3:32 of 3:29 on Heavyweight. Recognising anything else
+leaves the ad copy to be read, which across the first nineteen real episodes found 0%, 0%, 15%
+and 29% of what the lengths say is there. Spending the budget where the result can be trusted
+first is worth more than spending it in date order.
+
+Newest first within each group, because an episode about to be played is worth having words for
+before one from the back of a catalogue.
+*/
func (w *worker) pendingRecognition() []*store.Episode {
var pending []*store.Episode
for _, show := range w.state.Shows() {
@@ -608,8 +620,12 @@ func (w *worker) pendingRecognition() []*store.Episode {
}
}
}
- sort.Slice(pending, func(i, j int) bool {
- return pending[i].PublishedUnix > pending[j].PublishedUnix
+ sort.SliceStable(pending, func(i, j int) bool {
+ left, right := pending[i], pending[j]
+ if (left.MasterCues > 0) != (right.MasterCues > 0) {
+ return left.MasterCues > 0
+ }
+ return left.PublishedUnix > right.PublishedUnix
})
return pending
}