Skip to content

feat(series): optimize locale-focused image responses#367

Merged
wax911 merged 8 commits into
devfrom
feature/series-endpoint-image-optimization-plan
May 25, 2026
Merged

feat(series): optimize locale-focused image responses#367
wax911 merged 8 commits into
devfrom
feature/series-endpoint-image-optimization-plan

Conversation

@wax911

@wax911 wax911 commented May 25, 2026

Copy link
Copy Markdown
Member

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:

  • You have followed our contributing guidelines
  • Double checked that your branch is based on dev and targets dev (where applicable)
  • Pull request has tests (if applicable)
  • Documentation is updated (if necessary)
  • Description explains the issue/use-case resolved

Description

Optimizes v1/series image payloads by keeping cached canonical SeriesDocument data 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 like de-DE no longer surface assets such as ru when 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 than 404 responses.

Tests cover the image-selection helper, service integration, controller locale pass-through, ARM lookup error handling, and broader series module verification. Documentation was added under docs/superpowers/specs/2026-05-25-series-endpoint-image-optimization-design.md and docs/superpowers/plans/2026-05-25-series-endpoint-image-optimization.md.

Verification run for this branch:

  • deno task test -- --filter "series"
  • deno task check
  • deno task lint
  • manual local curl validation for no locale, en-US, ja-JP, and de-DE requests

IMPORTANT: 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.

@anitrend anitrend Bot added the 📚 docs label May 25, 2026
@wax911 wax911 merged commit 46044ac into dev May 25, 2026
12 checks passed
@wax911 wax911 deleted the feature/series-endpoint-image-optimization-plan branch May 25, 2026 13:59

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Auto approved automated PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant