feat(series): optimize locale-focused image responses#367
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AniTrend Pull Request
Thank you for contributing! Please take a moment to review our contributing guidelines
to make the process easy and effective for everyone involved.
Please open an issue before embarking on any significant pull request, especially those that
add a new library or change existing tests, otherwise you risk spending a lot of time working
on something that might not end up being merged into the project.
Before opening a pull request, please ensure you've done the following:
devand targetsdev(where applicable)Description
Optimizes
v1/seriesimage payloads by keeping cached canonicalSeriesDocumentdata intact while returning locale-focused images in the HTTP response.This change adds deterministic image selection that prefers Japanese artwork first, then the device language, and finally universal (
null) images for locale-specific requests. It intentionally stops before unrelated locales, so requests likede-DEno longer surface assets such asruwhen no German image exists. Requests without a locale still keep the broader fallback behavior so the endpoint can return a useful secondary image when available.The controller now reads client locale from request context and passes it into
SeriesService, where response-only filtering happens after repository retrieval. The series resolver also distinguishes true not-found cases from ARM upstream lookup failures with typed errors so ARM failures continue to surface as server errors rather than404responses.Tests cover the image-selection helper, service integration, controller locale pass-through, ARM lookup error handling, and broader
seriesmodule verification. Documentation was added underdocs/superpowers/specs/2026-05-25-series-endpoint-image-optimization-design.mdanddocs/superpowers/plans/2026-05-25-series-endpoint-image-optimization.md.Verification run for this branch:
deno task test -- --filter "series"deno task checkdeno task lintcurlvalidation for no locale,en-US,ja-JP, andde-DErequestsIMPORTANT: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the Apache License, Version 2.0.