Skip to content

feat(metadata): cast/crew profile photos + filterable production companies#308

Merged
detain merged 1 commit into
masterfrom
feat/cast-photos-and-companies
Jun 23, 2026
Merged

feat(metadata): cast/crew profile photos + filterable production companies#308
detain merged 1 commit into
masterfrom
feat/cast-photos-and-companies

Conversation

@detain

@detain detain commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Why

The media-detail page should show cast & key crew with profile photos, and production companies/studios that are clickable to filter the library. Currently TMDB profile images are dropped, cast is flattened to bare names, and production companies aren't persisted at all.

What (all additive — the actors flat-names + director string contract is untouched)

New metadata_json keys: cast[] ({name,role,profile_url}), crew[] ({name,job,profile_url}), production_companies[] ({name,logo_url,origin_country}), studio.

  • TmdbProvider: profileUrl()/logoUrl() (w185). Movies emit cast/crew/companies from credits+production_companies; TV from aggregate_credits (+ networks, created_by→Creator); getTvDetails now appends production_companies.
  • Movie/Series resolvers: guarded passthrough of the rich keys; actors stays flat.
  • MediaItemShaper::shapeDetail: exposes normalized cast/crew/production_companies/studio (list shape() stays lean); defensive normalizers tolerate legacy/malformed rows.
  • ItemRepository + WebPortalRouter: new companies[] filter — JSON_SEARCH over $.production_companies[*].name OR legacy $.studio, mirroring the actors filter.

Profile/logo URLs are stored as full TMDB URLs (same pattern as poster_url). SPA detail rendering (avatars + clickable studios) lands in the @phlix/ui PR.

Tests

New cases across TmdbProvider, both resolvers, MediaItemShaper (incl. legacy/malformed fallbacks + list-shape-stays-lean), ItemRepository (companies SQL/bindings), WebPortalRouter (companies[] forwarded). Full Unit/Media + WebPortal suites green (1001 tests). phpstan L9 clean, phpcs PSR-12 clean.

🤖 Generated with Claude Code

Enrich TMDB metadata so the media-detail page can render cast & key crew
with profile photos and clickable, filterable production companies. Today
profile images are dropped, cast is flattened to bare names, and production
companies are never persisted.

Additive only — the flat metadata_json['actors'] (names) and 'director'
(string) contract keys are untouched (the 'actors shape landmine'); the rich
data lands under NEW keys: cast[], crew[], production_companies[], studio.

- TmdbProvider: profileUrl()/logoUrl() (w185); movie + TV (aggregate_credits
  + networks + created_by) emit cast/crew/production_companies; getTvDetails
  appends production_companies.
- Movie/Series resolvers: guarded passthrough of the rich keys.
- MediaItemShaper::shapeDetail exposes normalized cast/crew/production_companies
  /studio (list shape stays lean); defensive normalizers.
- ItemRepository + WebPortalRouter: new companies[] filter (JSON_SEARCH over
  $.production_companies[*].name OR legacy $.studio).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@detain detain merged commit 5e4fb0d into master Jun 23, 2026
1 check was pending
@detain detain deleted the feat/cast-photos-and-companies branch June 23, 2026 17:23
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 18 medium · 31 minor

Alerts:
⚠ 49 issues (≤ 0 issues of at least minor severity)

Results:
49 new issues

Category Results
BestPractice 9 medium
Documentation 5 minor
CodeStyle 25 minor
Complexity 9 medium
Comprehensibility 1 minor

View in Codacy

🟢 Metrics 205 complexity · 0 duplication

Metric Results
Complexity 205
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.78761% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.28%. Comparing base (245502e) to head (3925126).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/Media/Library/MediaItemShaper.php 94.11% 4 Missing ⚠️
src/Media/Metadata/TmdbProvider.php 99.13% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #308      +/-   ##
============================================
+ Coverage     58.90%   59.28%   +0.37%     
- Complexity    12545    12623      +78     
============================================
  Files           474      474              
  Lines         41248    41472     +224     
============================================
+ Hits          24298    24587     +289     
+ Misses        16950    16885      -65     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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