Compare commits

..

7 Commits

7 changed files with 14 additions and 41 deletions

View File

@@ -1,19 +1,8 @@
FROM dunglas/frankenphp
ENV SERVER_NAME=":80"
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
FROM code.caldwell.digital/torsearch/torsearch-base:php8.4
ARG APP_VERSION="0.dev"
ENV APP_VERSION="${APP_VERSION}"
RUN install-php-extensions \
pdo_mysql \
gd \
intl \
zip \
opcache
COPY . /app
COPY --chmod=775 docker/app/entrypoint.sh /usr/local/bin/docker-entrypoint
COPY docker/app/Caddyfile /etc/frankenphp/Caddyfile

View File

@@ -1,6 +1,6 @@
ARG APP_VERSION
FROM code.caldwell.digital/torsearch/torsearch-app:${APP_VERSION}
FROM code.caldwell.digital/home/torsearch-app:${APP_VERSION}
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "scheduler_monitor" ]

View File

@@ -1,22 +1,6 @@
FROM dunglas/frankenphp:php8.4-alpine
ARG APP_VERSION
ENV SERVER_NAME=":80"
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
ARG APP_VERSION="0.dev"
ENV APP_VERSION="${APP_VERSION}"
RUN install-php-extensions \
pdo_mysql \
gd \
intl \
zip \
opcache
RUN apk add --no-cache wget
COPY . /app
FROM code.caldwell.digital/home/torsearch-app:${APP_VERSION}
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "async" ]

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.">