Fix movie/series API responses never surfacing company logo_path
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
movie_service.get_movie_detail() hardcoded companies[].logo_path = None instead of looking up the company's logo artwork, and tv_service's networks[]/companies[] never set logo_path at all -- both just built CompanyBriefOut without the artwork lookup that company_service.py (and _season_brief for posters) already does correctly. Ingestion and storage were working the whole time; the API layer just never read the result. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
2138d4afc3
commit
73488a0d80
@@ -11,6 +11,7 @@ import pytest
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.ids import aurora_id
|
||||
from app.models.artwork import Artwork
|
||||
from app.models.company import Company
|
||||
from app.models.credit import Credit
|
||||
@@ -18,6 +19,7 @@ from app.models.genre import Genre
|
||||
from app.models.movie import Movie
|
||||
from app.models.provider import ProviderRecord
|
||||
from app.providers.base import MetadataProvider
|
||||
from app.services import movie_service
|
||||
from app.services.ingestion.movie_ingestion import ingest_movie
|
||||
from tests.unit.test_normalizer import FAKE_MOVIE
|
||||
|
||||
@@ -128,3 +130,21 @@ async def test_ingest_movie_ingests_company_logo(db_session: AsyncSession):
|
||||
assert logo.artwork_type.value == "logo"
|
||||
assert logo.is_primary is True
|
||||
assert logo.original_url.endswith("/village-roadshow-logo.png")
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_movie_detail_surfaces_company_logo_path(db_session: AsyncSession):
|
||||
"""The ingested logo must actually reach the API response -- movie_service
|
||||
used to hardcode companies[].logo_path = None instead of looking up the
|
||||
company's artwork, so ingestion could succeed while the API still showed
|
||||
logo_path: None for every company."""
|
||||
|
||||
provider = FakeTMDbProvider(FAKE_MOVIE)
|
||||
movie_id = await ingest_movie(db_session, provider, "603")
|
||||
await db_session.commit()
|
||||
|
||||
detail = await movie_service.get_movie_detail(db_session, aurora_id("movie", str(movie_id)))
|
||||
|
||||
roadshow = next(c for c in detail.companies if c.name == "Village Roadshow Pictures")
|
||||
assert roadshow.logo_path is not None
|
||||
assert roadshow.logo_path.endswith("/village-roadshow-logo.png")
|
||||
|
||||
Reference in New Issue
Block a user