api: fix unread detection broken by substring match

The check `.contains("user/-/state/com.google/read")` was a substring
match, which also matched "user/-/state/com.google/reading-list" — a
category present on every article fetched from the reading list. This
caused all articles to be treated as read, so nothing ever appeared
bold in the sidebar.

Fix by using == for exact string comparison.
This commit is contained in:
Jeena 2026-03-22 01:58:51 +00:00
parent 9a4bf4b9f8
commit 2c5217e744

View file

@ -148,7 +148,7 @@ impl Api {
Ok(stream.items.into_iter().map(|item| {
let unread = !item.categories.as_deref().unwrap_or_default()
.iter()
.any(|c| c.contains("user/-/state/com.google/read"));
.any(|c| c == "user/-/state/com.google/read");
let content = item.summary
.as_ref()
.and_then(|s| s.content.clone())