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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user