fix/Improve Kodansha and YenPress Provider Safety #264
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.
Summary
This PR improves error handling and robustness for the Kodansha and YenPress metadata providers. It makes the
readableUrlfield optional in KodanshaBook, simplifies and improves the YenPress first book selection logic, and adds graceful error handling for YenPress series with empty book lists.Problem
The providers were experiencing issues when:
readableUrl, causing deserialization failuresChanges
1. Made
readableUrlOptional in KodanshaBooknullvalue to thereadableUrlfield inKodanshaBookdata classFiles changed:
komf-core/src/commonMain/kotlin/snd/komf/providers/kodansha/model/KodanshaBook.kt2. Improved YenPress First Book Selection Logic
it.number?.start != nullinstead ofit.number != null"No books found for YenPress series ${seriesId.value}"Files changed:
komf-core/src/commonMain/kotlin/snd/komf/providers/yenpress/YenPressMetadataProvider.kt3. Added Graceful Error Handling for YenPress Empty Book Lists
MetadataServicefor YenPress series with no booksmatchSeriesMetadataencounters a YenPress series with no books, it now logs at debug level and skips the provider instead of throwing an errorgetSeriesMetadataencounters this case, it re-throws the exception so it can be handled at a higher levellaunchJobto handle YenPress empty book list exceptions gracefully without emitting error eventsFiles changed:
komf-mediaserver/src/commonMain/kotlin/snd/komf/mediaserver/metadata/MetadataService.ktImpact
readableUrlis missing from API responsesTesting
The changes have been tested with:
readableUrlfieldFiles Changed
komf-core/src/commonMain/kotlin/snd/komf/providers/kodansha/model/KodanshaBook.ktkomf-core/src/commonMain/kotlin/snd/komf/providers/yenpress/YenPressMetadataProvider.ktkomf-mediaserver/src/commonMain/kotlin/snd/komf/mediaserver/metadata/MetadataService.kt