Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/graphql chapter pages mutation handle downloaded chapters #665

Conversation

schroda
Copy link
Collaborator

@schroda schroda commented Aug 23, 2023

No description provided.

@schroda schroda force-pushed the feature/graphql_chapter_pages_mutation_handle_downloaded_chapters branch from 3965c0d to 9f9e5f7 Compare August 23, 2023 22:01
Copy link
Collaborator

@Syer10 Syer10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to avoid getChapterDownloadReady unless its optimized, it does a lot of unneeded database queries

@schroda schroda force-pushed the feature/graphql_chapter_pages_mutation_handle_downloaded_chapters branch from 9f9e5f7 to 42a986c Compare August 27, 2023 11:54
In case the chapter is downloaded, fetching the chapter pages info should not be needed.
It should also currently break reading downloaded chapters while being offline, since the page request will always fail, since there is no internet connection
@schroda schroda force-pushed the feature/graphql_chapter_pages_mutation_handle_downloaded_chapters branch from 42a986c to 266bc4c Compare August 27, 2023 12:02
@schroda
Copy link
Collaborator Author

schroda commented Aug 27, 2023

I updated ChapterForDownload to work with just the chapterId being passed.
should get rid of the last duplicated transactions (chapter, manga), otherwise, I don't really see any unneeded queries.

I think it would be best to decouple logic like this. then you have one place which handles e.g. in this case getting the chapter pages.
In this case it matters for the rest api and graphql, but in other cases we might need the logic "internally" somewhere (not api relevant), e.g. the updater/downloader.
currently these places use the "old" (?) logic that was also used by the rest api and graphql does its own stuff.
which now causes changes to have to be done in two different places

@Syer10
Copy link
Collaborator

Syer10 commented Aug 28, 2023

The goal is to have GraphQL be as optimized as possible, while sharing code between it and the old Rest API is fine, its secondary since we don't plan to improve the Rest API in the future. When we drop the REST api we will drop a bunch of old code as well, anything that is not used by the GraphQL api will be removed, allowing us to further optimize the GraphQL api.

@Syer10 Syer10 merged commit 9ee3f46 into Suwayomi:master Aug 28, 2023
2 checks passed
@schroda schroda deleted the feature/graphql_chapter_pages_mutation_handle_downloaded_chapters branch August 28, 2023 13:24
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.

2 participants