Compare commits

...

5 Commits

6 changed files with 65 additions and 14 deletions

57
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c133ccd27ac6a41256bdc69129c16546",
"content-hash": "e055bbbbe5836c92bb147b6dbb1d1d46",
"packages": [
{
"name": "1tomany/rich-bundle",
@@ -9467,6 +9467,57 @@
],
"time": "2025-05-12T14:48:23+00:00"
},
{
"name": "symfony/serializer-pack",
"version": "v1.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/serializer-pack.git",
"reference": "2844d81a5fc86b617b82f44a8bfcaaba1d583eee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/serializer-pack/zipball/2844d81a5fc86b617b82f44a8bfcaaba1d583eee",
"reference": "2844d81a5fc86b617b82f44a8bfcaaba1d583eee",
"shasum": ""
},
"require": {
"phpdocumentor/reflection-docblock": "*",
"phpstan/phpdoc-parser": "*",
"symfony/property-access": "*",
"symfony/property-info": "*",
"symfony/serializer": "*"
},
"conflict": {
"symfony/property-info": "<5.4",
"symfony/serializer": "<5.4"
},
"type": "symfony-pack",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A pack for the Symfony serializer",
"support": {
"issues": "https://github.com/symfony/serializer-pack/issues",
"source": "https://github.com/symfony/serializer-pack/tree/v1.3.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2023-06-03T13:55:25+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v3.6.0",
@@ -13347,7 +13398,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
@@ -13355,7 +13406,7 @@
"ext-ctype": "*",
"ext-iconv": "*"
},
"platform-dev": [],
"platform-dev": {},
"platform-overrides": {
"php": "8.4"
},

View File

@@ -68,7 +68,7 @@ class Monitor
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
private ?self $parent = null;
#[ORM\OneToMany(targetEntity: self::class, mappedBy: 'parent')]
#[ORM\OneToMany(targetEntity: self::class, mappedBy: 'parent', cascade: ['remove'])]
private Collection $children;
public function __construct()

View File

@@ -16,10 +16,10 @@ class TmdbTvEpisodeResultDenormalizer implements DenormalizerInterface
private readonly NormalizerInterface $normalizer,
) {}
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): TmdbResult|array|null
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): TmdbResult|TmdbEpisodeDto|array|null
{
/** @var TmdbEpisodeDto $result */
$result = $this->normalizer->denormalize($data, TmdbResult::class, $format, $context);
$result = $this->normalizer->denormalize($data, TmdbEpisodeDto::class, $format, $context);
return $result;
}

View File

@@ -48,7 +48,7 @@ class TmdbTvShowResultDenormalizer extends TmdbResultDenormalizer implements Den
array $context = []
): bool {
return array_key_exists('media_type', $context) &&
$context['media_type'] === "tvshows";
$context['media_type'] === MediaType::TvShow->value;
}
public function getSupportedTypes(?string $format): array

View File

@@ -143,13 +143,13 @@ class TmdbClient
{
$tmdbId = $this->findByImdbId($imdbId)['id'];
$media = $this->tvRepository->getApi()->getTvShow($tmdbId, ['append_to_response' => 'external_ids,credits']);
$media['seasons'] = Map::from($media['seasons'])->filter(function ($data) {
return $data['season_number'] !== 0 &&
strtolower($data['name']) !== 'specials';
strtolower($data['name']) !== 'specials' &&
$data['episode_count'] > 0;
})->map(function ($data) use ($media) {
return $this->tvSeasonDetails($media['id'], $data['season_number'])['episodes'];
})->rekey(function ($data) {
return $data[1]['season_number'];
})->toArray();
return $this->parseResult(

View File

@@ -10,9 +10,9 @@
<twig:Card title="" class="w-full" contentClass="flex flex-col gap-4 justify-between w-full text-gray-50">
<div class="p-2 md:p-4 flex flex-col md:flex-row gap-6">
{% if results.media.poster != null %}
<img class="w-full md:w-40 rounded-lg" src="{{ results.media.poster }}" />
<img class="w-full md:w-[12.5rem] rounded-lg" src="{{ results.media.poster }}" />
{% else %}
<div class="w-full md:w-40 h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
<div class="w-full md:w-[12.5rem] h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
<twig:ux:icon width="24" name="hugeicons:loading-01" />
</div>
{% endif %}
@@ -20,7 +20,7 @@
<div class="w-full flex flex-col">
<div class="mb-4 flex flex-row gap-2 justify-between">
<h3 class="text-xl font-medium leading-tight font-bold text-gray-50">
{{ results.media.title }} ({{ results.media.episodeAirDate|date('Y') }})
{{ results.media.title }} ({{ results.media.year }})
</h3>
{% if results.media.mediaType == "tvshows" %}
@@ -109,7 +109,7 @@
</twig:Turbo:Frame>
<span class="py-1 px-1.5 mr-1 grow-0 font-bold bg-sky-700 rounded-lg text-white" title="Release date {{ results.media.episodeAirDate }}">
{{ results.media.episodeAirDate|date('n/j/Y', 'UTC') }}
{{ results.media.premiereDate|date('n/j/Y', 'UTC') }}
</span>
<span class="py-1 px-1.5 mr-1 grow-0 font-bold bg-orange-500 rounded-lg text-white" title="This movie has a runtime of {{ results.media.runtime }} minutes.">