feat: adds poster to monitors & ical

This commit is contained in:
Brock H Caldwell
2025-11-05 23:42:40 -06:00
parent cd14a197aa
commit 1f1c6f775f
2 changed files with 16 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Monitor\Framework\Controller;
use Aimeos\Map;
use App\Monitor\Framework\Entity\Monitor;
use App\Monitor\Framework\Repository\MonitorRepository;
use App\User\Framework\Entity\User;
use Spatie\IcalendarGenerator\Components\Calendar;
@@ -27,9 +28,10 @@ class CalendarController extends AbstractController
->refreshInterval(10);
$monitors = $monitorRepository->whereAirDateNotNull();
$calendar->event(Map::from($monitors)->map(function ($monitor) {
$calendar->event(Map::from($monitors)->map(function (Monitor $monitor) {
return new Event($monitor->getTitle())
->startsAt($monitor->getAirDate())
->attachment($monitor->getPoster())
->fullDay();
})->toArray());