summaryrefslogtreecommitdiff
path: root/server/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'server/cmd')
-rw-r--r--server/cmd/listend/main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/cmd/listend/main.go b/server/cmd/listend/main.go
index 2298db5..a165feb 100644
--- a/server/cmd/listend/main.go
+++ b/server/cmd/listend/main.go
@@ -352,7 +352,7 @@ func (w *worker) pollOne(ctx context.Context, feedURL string) {
show.LastPolledUnix = time.Now().Unix()
show.LastError = ""
- kept, pruned := show.Partition(w.keep)
+ kept, pruned := show.Partition(w.keep, time.Now().Unix())
for _, e := range pruned {
if e.Mirrored() {
_ = w.mirror.Prune(e)
@@ -555,6 +555,10 @@ func (w *worker) serveRequest(ctx context.Context, req request) {
return
}
}
+ // The api marks episodes it can see; this covers the one it could not, which was registered
+ // from what the phone told us a moment ago. Without it the newly-known episode has no
+ // record of being wanted and the next poll prunes what was just fetched for it.
+ e.Requested(time.Now().Unix())
if e.Mirrored() {
return
}
@@ -565,7 +569,7 @@ func (w *worker) serveRequest(ctx context.Context, req request) {
log.Printf("on-demand: mirrored %s", e.Title)
if show := w.state.Show(req.feedURL); show != nil {
- kept, _ := show.Partition(w.keep)
+ kept, _ := show.Partition(w.keep, time.Now().Unix())
w.detect(ctx, show, kept)
}
}