Add enriched image lookup fallbacks for external entities - #5
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a2eaf25f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Add guidance for cold and warm Cargo builds - Explain timeout and build-directory lock handling
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb15083691
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| .await?; | ||
| writer.write_all(&resized).await?; | ||
| let (_, mut writer) = local_provider.get_file_write_stream(&image_path).await?; |
There was a problem hiding this comment.
Use the cache path returned by the writer
When concurrent requests miss the same cache entry, PathProvider::get_file_write_stream avoids overwriting by creating a suffixed file and returning its actual path, but this code discards that path. The second request therefore leaves an orphan on success; on failure, line 162 removes the first request's valid file while retaining its own partial suffixed file. Fresh evidence after the earlier cache-poisoning report is the collision behavior in src/plugins/sources/path_provider.rs:194-217; serialize creation or track the returned path for cleanup and publication.
Useful? React with 👍 / 👎.
What changed
This PR updates external image lookup for movies, books, and people to follow the same fallback pattern already introduced for series:
It also refactors the external-ID person image path to use the shared cached entity image helper instead of a custom cache/write implementation.
Why it changed
Some image providers resolve only a subset of external IDs. A common example is TV artwork that can be found only after enriching a
tmdb:*entity withtvdb.Without this fallback, external detail pages could show metadata correctly but still fail to display artwork because image lookup was attempted only with the original ID from the route.
Impact
Root cause
The server’s external image paths were inconsistent across entity types. Some routes could resolve richer metadata objects, but the image fetch path still queried plugins using only the raw route ID.
Validation
cargo check --bin redseat-rustcargo test enriched_episode_lookup --bin redseat-rustcargo test external_serie_image_fallback --bin redseat-rust