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:
2026-09-10 18:45:46 +00:00
parent 8f5e2749ff
commit 7473d5b7fb
5 changed files with 46 additions and 4 deletions

View File

@@ -681,9 +681,15 @@ impl Db {
}
/// Marks every entry in a feed read, for the "mark all read" button.
pub fn mark_all_read(&self, feed_id: &str) -> Result<usize> {
/// Marks every entry of the given feeds read. Takes a list because an OPML subscription
/// holds no entries itself -- marking it read means the feeds inside it.
pub fn mark_all_read(&self, feed_ids: &[String]) -> Result<usize> {
let conn = self.conn.lock().unwrap();
Ok(conn.execute("UPDATE entries SET read = 1 WHERE feed_id = ?1 AND read = 0", [feed_id])?)
let mut n = 0;
for id in feed_ids {
n += conn.execute("UPDATE entries SET read = 1 WHERE feed_id = ?1 AND read = 0", [id])?;
}
Ok(n)
}
/// The next N enclosures with no file, newest entry first -- what "download latest"