-
-
Notifications
You must be signed in to change notification settings - Fork 449
Feat/komga api #2071
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
base: develop
Are you sure you want to change the base?
Feat/komga api #2071
Conversation
Merge Develop into Master for release
Merge Develop into Master for release
Merge Develop into Master for release
Merge Develop into Master for release
Merge Develop into Master for release
Merge Develop into Master for release
Merge develop into master for release
Merge develop into master for release
Merge develop into master for release
Merge Develop into Master for Release
Merge pull request booklore-app#847 from booklore-app/develop
Merge pull request booklore-app#847 from booklore-app/develop
Try fixing versioning #2
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into master for the release
Merge develop into the master for release
Merge develop into the master for release
Merge develop into master for release
Merge develop into master for release
Merge develop itno master for the release
Merge develop into master for the release
|
@farfromrefug i haven't see new commit |
|
Do you manage reading progress ? |
|
@beudbeud my bad pushed now. About reading progress no it is not implemented. But it seems booklore already have an api for this. So it is a matter of integrating this into other apps. |
|
thanks it's work now About reading progression it will be difficult i think because we use not internal user of Booklore just the OPDS user |
|
For me, all work perfectly and can be merge |
good point. Then i could implement komga like progress api in the future. TBh i dont use it |
- Optimize getAllSeries to only convert series on current page to DTOs - Optimize getBooksBySeries to fetch books only once (not twice) - Add database query methods for future optimizations - Update tests to work with new optimizations - All existing tests pass Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Remove unused optimization queries that don't align with application-level series grouping logic Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
- Add database queries to fetch distinct series names directly (no need to load all books) - Add queries to fetch books only for specific series (when building DTOs) - Support both groupUnknown=true and groupUnknown=false modes - Add test to verify optimization works and books aren't loaded unnecessarily - Performance improvement: For 1000+ books grouped into 100+ series, now only queries series names (~100 rows) instead of loading all books (~1000+ rows), then loads books only for the current page (~20-50 books per series on page) Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
…erformance Optimize Komga API series listing with database-level query optimization
|
@beudbeud i was not really happy with performances in this PR, so i made some changes for faster db requests. if you could test again that would be great @acx10 could i ask for this to be reviewed now? I am afraid some new migrations will come which will conflict with this PR migration numbers |
|
i have issue now about migration |
|
@beudbeud yes this is normal as migrations have changed in main branch and conflict with this branch. |
|
@farfromrefug can you give me explain for update manually the database? |
|
@beudbeud you need to open the mariadb database (connect to it) then open the flyway_schema_history table and fix the errors as per the messages you get. Which means changing the checksum. Then when you run it again change the description as per errors. |
|
@beudbeud no it was not. sorry pushed and fix. You still have to fix your db |
|
i fixed the database, it's work nice |
|
@farfromrefug The code looks good at a glance. I’ll review it thoroughly this weekend. |
|
@acx10 awesome thank you! here you go booklore-app/booklore-docs#23 |
# Conflicts: # booklore-api/src/main/java/com/adityachandel/booklore/repository/BookRepository.java
| "/api/v1/auth/**", // Login and token refresh endpoints (must remain public) | ||
| "/api/v1/public-settings", // Public endpoint for checking OIDC or other app settings | ||
| "/api/v1/setup/**", // Setup wizard endpoints (must remain accessible before initial setup) | ||
| "/api/v1/healthcheck/**" // Healthcheck endpoints (must remain accessible for Docker healthchecks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add this back
"/api/v1/healthcheck/**"
| * Jackson configuration for Komga API clean mode. | ||
| */ | ||
| @Configuration | ||
| public class JacksonConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config registers a @primary ObjectMapper and applies a BeanSerializerModifier globally, which will affect serialization across the entire app. That’s pretty risky.
Can we scope this to a dedicated ObjectMapper and only use it where needed (e.g., specific endpoints or services) instead of changing global behavior?
|
|
||
| @Bean | ||
| @Order(2) | ||
| public SecurityFilterChain komgaBasicAuthSecurityChain(HttpSecurity http) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need a separate SecurityFilterChain for this? Can we reuse or extend the existing security configuration instead of introducing another one? It would be good to understand what this chain adds that the current setup doesn’t cover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was just "copying" OPDS api security chain. You want me to use the same one? I am ok with that but wouldn't that mean that the WWW-Authenticate header would report the OPDS realm?
| "resulting in smaller and cleaner JSON payloads.") | ||
| @Slf4j | ||
| @RestController | ||
| @RequestMapping(value = "/komga/api", produces = "application/json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the base path to something like /api/komga/v1? That way we can avoid having to update nginx.conf and keep the routing consistent with the existing API structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acx10 actually this is problematic to be compatible with komga clients. They all use /api/komga/v1 by happending to the host. If we change that none of them will work :s


🚀 Pull Request
📝 Description
This PR adds a new Komga compatible API.
This is draft for now. I need to clean the workflow change i had to implement to get github packages docker releases.
Have to see about the doc.
🛠️ Changes Implemented
Added the new Komga API, added backend API and frontend setting to enable it
there is a new
cleanquery parameter not supported by the official komga API. When enabled the API results will be cleared of unused/unnecessary fields for apps supporting it (koma for one). null fields, empy arrays,...Lockfields are not returned🧪 Testing Strategy
I use the API directly with a Komga plugin for Mihon. I am also writing a Booklore plugin with more features
developbranch./gradlew testfor backend)