Currently Listening: finished is 90% played, not read

Opening an episode marks it read, so filtering on read hid every
episode anyone had started. The player now also reports the length it
measured, filling in one the feed left out. Fixes #14.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 17:47:57 +00:00
parent 49dafedbbc
commit 57a6fb5daa
6 changed files with 86 additions and 27 deletions

View File

@@ -1374,6 +1374,8 @@ async fn media(
#[derive(Deserialize)]
struct Position {
secs: i64,
/// The length the player measured, for an episode whose feed gives none.
duration: Option<i64>,
}
async fn set_position(
@@ -1382,7 +1384,7 @@ async fn set_position(
user: crate::db::User,
Json(body): Json<Position>,
) -> Result<StatusCode, ApiError> {
state.ctx.db.set_position(user.id, &feed_id, &guid, body.secs)?;
state.ctx.db.set_position(user.id, &feed_id, &guid, body.secs, body.duration)?;
Ok(StatusCode::NO_CONTENT)
}