forked from Stirling-Tools/Stirling-PDF
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from Stirling-Tools:main #128
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ive booleans and adopt `is*` accessors to reduce null checks/NPE risk (#4153) # Description of Changes **What was changed** - Switched multiple nullable `Boolean` fields to primitive `boolean` in `ApplicationProperties`: - `Security.enableLogin`, `Security.csrfDisabled` - `System.googlevisibility`, `System.showUpdateOnlyAdmin`, `System.enableAlphaFunctionality`, `System.disableSanitize`, `System.enableUrlToPDF` - `Metrics.enabled` - Updated all consumers to use Lombok’s `is*` accessors instead of `get*`: - `AppConfig`, `PostHogService`, `CustomHtmlSanitizer`, `EndpointConfiguration`, `InitialSetup`, `OpenApiConfig`, `ConvertWebsiteToPDF`, `HomeWebController`, `MetricsController`, proprietary `SecurityConfiguration`, `AccountWebController` - Tests adjusted to mock `isDisableSanitize()` instead of `getDisableSanitize()` - Logic simplifications: - Removed redundant null-handling/ternaries now that primitives have defaults (e.g., `enableAlphaFunctionality` bean) - Replaced `Boolean.TRUE.equals(...)` with direct primitive checks - Used constant-first `equals` for NPE safety in string comparisons **Why the change was made** - Primitive booleans eliminate ambiguity, cut down on `NullPointerException` risks, and simplify conditions - Aligns with Java/Lombok conventions (`isX()` for `boolean`) for clearer, more consistent APIs - Spring provides sane defaults for missing booleans (`false`), reducing boilerplate and cognitive load --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details.
…T/DOCX) (#4644) This pull request adds support for converting common eBook formats (EPUB, MOBI, AZW3, FB2, TXT, DOCX) to PDF using Calibre. It introduces a new API endpoint and updates the configuration, dependency checks, and documentation to support this feature. Additionally, it includes related UI and localization changes. **New eBook to PDF conversion feature:** * Added `ConvertEbookToPDFController` with a new `/api/v1/convert/ebook/pdf` endpoint to handle eBook to PDF conversion using Calibre, supporting options like embedding fonts, including table of contents, and page numbers. * Introduced `ConvertEbookToPdfRequest` model for handling conversion requests and options. **Configuration and dependency management:** * Updated `RuntimePathConfig`, `ApplicationProperties`, and `ExternalAppDepConfig` to support Calibre's executable path configuration and dependency checking, ensuring Calibre is available and correctly integrated. [[1]](diffhunk://#diff-68c561052c2376c3d494bf11dd821958acd9917b1b2d33a7195ca2d6df7ec517R24) [[2]](diffhunk://#diff-68c561052c2376c3d494bf11dd821958acd9917b1b2d33a7195ca2d6df7ec517R61) [[3]](diffhunk://#diff-68c561052c2376c3d494bf11dd821958acd9917b1b2d33a7195ca2d6df7ec517R72-R74) [[4]](diffhunk://#diff-1c357db0a3e88cf5bedd4a5852415fadad83b8b3b9eb56e67059d8b9d8b10702R359) [[5]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR26-R34) [[6]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR48) [[7]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR63-R68) [[8]](diffhunk://#diff-8932df49d210349a062949da2ed43ce769b0f107354880a78103664f008f849eR132) * Registered the new endpoint and tool group in `EndpointConfiguration`, including logic to enable/disable the feature based on Calibre's presence. [[1]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R260) [[2]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437R440-R442) [[3]](diffhunk://#diff-3cddb66d1cf93eeb8103ccd17cee8ed006e0c0ee006d0ee1cf42d512f177e437L487-R492) **Documentation and localization:** * Updated the `README.md` to mention eBook to PDF conversion support. * Added UI route and form for eBook to PDF conversion in the web controller. * Added English and German localization strings for the new feature, including descriptions, labels, and error messages. [[1]](diffhunk://#diff-ee1c6999a33498cfa3abba4a384e73a8b8269856899438de80560c965079a9fdR617-R620) [[2]](diffhunk://#diff-482633b22866efc985222c4a14efc5b7d2487b59f39b953f038273a39d0362f7R617-R620) [[3]](diffhunk://#diff-482633b22866efc985222c4a14efc5b7d2487b59f39b953f038273a39d0362f7R1476-R1485) ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )