Skip to content

TV secondary enrichment passes a TVDB provider_id to TMDB get_metadata — wrong ID namespace yields wrong or absent data #417

Description

@forkwright

Finding

enrich_from_secondary() for MediaType::Tv calls self.tmdb.get_metadata(&identity.provider_id.0), where identity.provider_id is the canonical TVDB series ID. TMDB and TVDB use independent numeric ID namespaces, so a TVDB series ID does not address the same entity in TMDB. The call either (a) silently returns data for an unrelated TMDB entry that happens to share the number, or (b) returns a 404 that is swallowed by .await.ok()?, producing no enrichment.

Evidence

crates/epignosis/src/resolver.rs:420:

let meta = self.tmdb.get_metadata(&identity.provider_id.0).await.ok()?;

The provider_id originates from the TVDB search path at crates/epignosis/src/providers/tvdb.rs:124:

id = series.tvdb_id.unwrap_or_default()

so the value flowing into TMDB's get_metadata is unambiguously a TVDB ID.

Why this matters

enrich_from_secondary for TV exists to augment TVDB metadata with TMDB fields (posters, overviews, etc.). As written it always either silently fails or injects data for an unrelated entity, so secondary enrichment for every TV item is a no-op or a data-quality corruption. The .ok()? discards the error, so the failure is invisible — incorrect metadata can be surfaced to the user as authoritative with no signal that a mismatch occurred.

Desired correction

Resolve the TMDB entity from the TVDB identity via an explicit cross-reference rather than reusing the raw ID: query TMDB's /find/{external_id}?external_source=tvdb_id (which accepts TVDB IDs and returns the matching TMDB entity), or fall back to a TMDB title search (/search/tv?query={title}). Done when: a known TV series resolved via TVDB produces a secondary enrichment containing the correct TMDB entry.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions