DeadAir shortens episodes opened but not played (#173)

The copy maker skips an episode everyone who would hear the copy has
finished, and took finished to be the read mark. Opening an item sets it
as well, so 359: Potatoes From the Sky, opened and downloaded with
DeadAir on for its show, got no copy. Finished is now a place at 90% of
the length or past it, as Currently Listening has it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 18:48:25 +00:00
parent 00bc039964
commit 845448a754
3 changed files with 17 additions and 8 deletions

View File

@@ -268,7 +268,7 @@ async fn have_ffmpeg() -> bool {
}
/// Makes one copy someone wants, if there is one to make. A file everyone who would play the
/// copy has already finished gets none: finished episodes are rarely played again.
/// copy has already heard through gets none: finished episodes are rarely played again.
// shortcut: those stay on the list and are looked at again each pass, one query each; record
// them as passed over if a large library makes the pass slow.
async fn next(ctx: &Ctx) -> Result<bool> {
@@ -283,8 +283,8 @@ async fn next(ctx: &Ctx) -> Result<bool> {
if users.is_empty() || !ctx.db.subscribed_any(&users, &t.feed_id).await? {
continue;
}
let readers = ctx.db.readers(&t.feed_id, &t.guid).await?;
if users.iter().all(|u| readers.contains(u)) {
let finished = ctx.db.finished(&t.feed_id, &t.guid).await?;
if users.iter().all(|u| finished.contains(u)) {
continue;
}
let src = crate::download::playable(Path::new(&t.path));