feat: include release year in film hint text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thibaud-leclere
2026-04-02 00:25:05 +02:00
parent 2e7d7ecf44
commit 843009e193

View File

@@ -240,13 +240,28 @@ class GameGridProvider
} }
return match ($type) { return match ($type) {
'film' => $this->movieRepository->find((int) $data)?->getTitle(), 'film' => $this->resolveFilmHintText((int) $data),
'character' => $this->movieRoleRepository->find((int) $data)?->getCharacter(), 'character' => $this->movieRoleRepository->find((int) $data)?->getCharacter(),
'award' => $this->resolveAwardHintText((int) $data), 'award' => $this->resolveAwardHintText((int) $data),
default => null, default => null,
}; };
} }
private function resolveFilmHintText(int $movieId): ?string
{
$movie = $this->movieRepository->find($movieId);
if ($movie === null) {
return null;
}
$title = $movie->getTitle();
if ($movie->getYear() !== null) {
$title .= ' (' . $movie->getYear() . ')';
}
return $title;
}
private function resolveAwardHintText(int $awardId): ?string private function resolveAwardHintText(int $awardId): ?string
{ {
$award = $this->awardRepository->find($awardId); $award = $this->awardRepository->find($awardId);