Mark all read on an OPML subscription
Marking the subscription read did nothing: its own row holds no entries. read-all now resolves the feeds grouped under the id -- via subscriptions(), so a child promoted to config is included -- and marks those. Button sits before Unsubscribe, where every other feed keeps it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AdXho5tTkjFLeUXKbEjKBh
This commit is contained in:
10
src/web.rs
10
src/web.rs
@@ -660,7 +660,15 @@ async fn read_all(
|
||||
State(state): State<WebState>,
|
||||
Path(id): Path<String>,
|
||||
) -> Result<Json<serde_json::Value>, ApiError> {
|
||||
let n = state.ctx.db.mark_all_read(&id)?;
|
||||
// A subscription's own row has no entries, so marking it read means everything under it.
|
||||
let mut ids = vec![id.clone()];
|
||||
ids.extend(
|
||||
crate::subscriptions(&state.ctx)?
|
||||
.into_iter()
|
||||
.filter(|s| s.cfg.group.as_deref() == Some(id.as_str()))
|
||||
.map(|s| s.id),
|
||||
);
|
||||
let n = state.ctx.db.mark_all_read(&ids)?;
|
||||
Ok(Json(serde_json::json!({ "marked": n })))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user