v2
v2 copied to clipboard
Get Categories API: Add count of read/unread items
- [X ] I have read this document: https://miniflux.app/opinionated.html#feature-request
when calling /v1/categories, it would simplify client development to return the available items for a category.
now:
[{"id":13,"title":"All","user_id":2}]
proposed:
[{"id":13,"title":"All","unread":232,"read":"41","total":273,"user_id":2}]
It could also just be the unread count.
This is a great application, thanks for writing it.
I commented on a similar issue: https://github.com/miniflux/v2/issues/512#issuecomment-797868878
Hi,
Counting at category level might be a performance concern because it require join and count on a lot of data in the server.
You might be interested in my PR #1431 to fetch the feed count. It is based on fetchFeedCounter() which is quite efficent and straighforward.
It does not "simplify client development" but it make it possible for your frontend to infer the category count if you map the feed categories with this feed count client side.
Regards, Pascal