Skip to content

Add chapter stats to MangaTable with GraphQL sort/filter support#1719

Open
everpcpc wants to merge 1 commit intoSuwayomi:masterfrom
everpcpc:feat-sort
Open

Add chapter stats to MangaTable with GraphQL sort/filter support#1719
everpcpc wants to merge 1 commit intoSuwayomi:masterfrom
everpcpc:feat-sort

Conversation

@everpcpc
Copy link

@everpcpc everpcpc commented Oct 13, 2025

Summary

  • Add chaptersLastReadAt, chaptersLastUploadDate, chaptersUnreadCount, chaptersTotalCount to MangaTable
  • Support sorting and filtering these fields in GraphQL MangaQuery
  • Auto-update stats when chapters are fetched or modified
  • Add database migration M0053_AddMangaChapterStatsColumns

Related

… support

- Add chaptersLastReadAt, chaptersLastUploadDate, chaptersUnreadCount, chaptersTotalCount to MangaTable
- Support sorting and filtering these fields in GraphQL MangaQuery
- Auto-update stats when chapters are fetched or modified
- Add database migration M0053_AddMangaChapterStatsColumns
@Syer10
Copy link
Collaborator

Syer10 commented Oct 13, 2025

This should be done using joins and other database queries. It shouldn't be done by adding the columns to the manga table directly

@everpcpc
Copy link
Author

Sorting with join queries can be very complex, especially for operations like count. The query efficiency will be very low and may greatly impact performance.

@Robonau
Copy link
Contributor

Robonau commented Oct 14, 2025

write both
test the speed difference
and post findings

if the performance difference is substantial enough syer may change his mind

@Syer10
Copy link
Collaborator

Syer10 commented Oct 14, 2025

Some test code I wrote a while ago to provide an example for the join kind of implementation.

Syer10@a88ebfb

And for asCursor I won't mind if there are @GraphqlIgnore fields in the MangaType to handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments