Add movies/series filmography to company detail
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
GET /companies/{id} showed only the company's own info. Adds movies
and series lists (any role: production, distribution, network),
ordered by release/first-air date, read straight off the existing
movie_companies/series_companies junction rows -- no separate sync
needed since those only ever exist as a side effect of ingesting the
movie or series itself.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
606d2532c4
commit
6956bf7406
@@ -12,6 +12,8 @@ from app.repositories import company_repository, polymorphic
|
||||
from app.schemas.common import CompanyBriefOut
|
||||
from app.schemas.company import CompanyDetailOut
|
||||
from app.services.common import primary_artwork_path
|
||||
from app.services.movie_service import build_movie_summaries
|
||||
from app.services.tv_service import build_series_summaries
|
||||
|
||||
|
||||
class CompanyNotFoundError(Exception):
|
||||
@@ -33,6 +35,8 @@ async def get_company_detail(session: AsyncSession, company_aurora_id: str) -> C
|
||||
|
||||
logos = await polymorphic.get_artwork(session, "company", company_id, ArtworkType.LOGO)
|
||||
external_ids = await polymorphic.get_external_ids(session, "company", company_id)
|
||||
movies = await company_repository.get_company_movies(session, company_id)
|
||||
series = await company_repository.get_company_series(session, company_id)
|
||||
|
||||
return CompanyDetailOut(
|
||||
id=aurora_id("company", str(company.id)),
|
||||
@@ -49,6 +53,8 @@ async def get_company_detail(session: AsyncSession, company_aurora_id: str) -> C
|
||||
else None
|
||||
),
|
||||
external_ids=external_ids,
|
||||
movies=await build_movie_summaries(session, [m.id for m in movies]),
|
||||
series=await build_series_summaries(session, [s.id for s in series]),
|
||||
created_at=company.created_at,
|
||||
updated_at=company.updated_at,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user