Skip to content

Add enriched image lookup fallbacks for external entities - #5

Merged
neckaros merged 3 commits into
masterfrom
agent/external-image-enriched-fallbacks
Aug 8, 2026
Merged

Add enriched image lookup fallbacks for external entities#5
neckaros merged 3 commits into
masterfrom
agent/external-image-enriched-fallbacks

Conversation

@neckaros

@neckaros neckaros commented Aug 8, 2026

Copy link
Copy Markdown
Owner

What changed

This PR updates external image lookup for movies, books, and people to follow the same fallback pattern already introduced for series:

  • try image lookup first with the raw provided external ID
  • if that lookup fails, resolve the entity through metadata/store lookup
  • retry image lookup with the resolved local ID or enriched external IDs

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 with tvdb.

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

  • external movie, book, and person detail pages now have a second chance to resolve artwork when the original ID is insufficient
  • local-ID behavior is unchanged
  • the fast path is preserved because the code still tries the raw ID first
  • person image handling is more consistent with the shared entity image flow

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-rust
  • cargo test enriched_episode_lookup --bin redseat-rust
  • cargo test external_serie_image_fallback --bin redseat-rust

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/model/people.rs Outdated
Comment thread src/model/movies.rs
- Add guidance for cold and warm Cargo builds
- Explain timeout and build-directory lock handling
@neckaros
neckaros merged commit 4e2278b into master Aug 8, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@neckaros
neckaros deleted the agent/external-image-enriched-fallbacks branch August 8, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant