Repository navigation
[codex] Gate episode refresh debt on provider provenance - #60
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR introduces ChangesActionable Metadata Debt
Sequence Diagram(s)This PR does not meet the criteria for sequence diagram generation—the changes are primarily a logic substitution replacing one internal function call with another across multiple call sites, without introducing new component interactions or significant control flow changes. Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d31876812c
ℹ️ 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".
| if !episodeHasProviderMatch(ep) { | ||
| return true |
There was a problem hiding this comment.
Treat plugin-only provider IDs as matches
When an episode comes from a plugin whose capability is not tmdb, tvdb, or imdb, this new check keeps returning actionable debt even after a successful provider refresh. PluginProvider.GetEpisodes can populate EpisodeResult.ProviderIDs with p.capabilityID, but persistSeasonsAndEpisodes only copies imdb/tmdb/tvdb onto models.Episode, so a custom-provider episode is persisted as MetadataSource: "provider" with all three checked ID fields empty. In that context EpisodeHasActionableMetadataDebt never clears the episode/season debt and the scheduled refresh queue can repeatedly refresh already-provider-backed episodes.
Useful? React with 👍 / 👎.
| if !episodeHasProviderMatch(ep) { | ||
| return true |
There was a problem hiding this comment.
Keep the debt backfill predicate in sync
On fresh databases or upgrades where migration 100 runs with this code, the migration still inserts due episode debts using the old incomplete predicate (Episode N titles and empty overviews), while this new predicate immediately treats provider-backed episodes with TMDB/TVDB/IMDB IDs as non-actionable. In libraries with many provider-numbered or overview-less episodes, the scheduler will enqueue and run an avoidable refresh for each of those rows just to clear the debt afterward, so the backfill/cleanup criteria should be updated to match the new actionable definition.
Useful? React with 👍 / 👎.
Summary
EpisodeHasActionableMetadataDebtpredicate for refresh schedulingEpisodeHasIncompleteMetadataas the broader quality/incompleteness checkepisode_metadata_incompletestate through actionable debtEpisode Nrows, empty provider overviews, provisionalTBD, scanner fallback, missing IDs, and recent missing stillsRoot Cause
EpisodeHasIncompleteMetadatatreated anyEpisode Ntitle or empty overview as incomplete. That predicate was also used as refresh debt, so provider-matched episodes whose canonical metadata isEpisode 1or has no overview could permanently regenerate episode refresh debt.Behavior
Provider-matched episodes with a provider ID no longer create actionable refresh debt solely because the provider title is
Episode Nor the overview is empty. Empty titles, scanner fallback rows, missing provider IDs, providerTBA/TBD, and recent episodes missing still images still create refresh debt.Validation
go test ./internal/metadata ./internal/api/handlers ./internal/adminjob -count=1go test ./...make verify-local-pathsAI Disclosure
Implemented with Codex.
Summary by CodeRabbit