Compare commits
5 Commits
monitor-on
...
dev-monito
| Author | SHA1 | Date | |
|---|---|---|---|
| 12aaf8e737 | |||
| 2e468dd9b0 | |||
| e070b95a36 | |||
| 20d397589a | |||
| 6c7a35005e |
@@ -20,7 +20,7 @@ export default class extends Controller {
|
|||||||
"provider": "",
|
"provider": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
static outlets = ['movie-results', 'tv-results']
|
static outlets = ['movie-results', 'tv-results', 'tv-episode-list']
|
||||||
static targets = ['resolution', 'codec', 'language', 'provider', 'season', 'selectAll', 'downloadSelected']
|
static targets = ['resolution', 'codec', 'language', 'provider', 'season', 'selectAll', 'downloadSelected']
|
||||||
static values = {
|
static values = {
|
||||||
'media-type': String,
|
'media-type': String,
|
||||||
@@ -127,6 +127,10 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSeason(event) {
|
||||||
|
this.tvEpisodeListOutlet.setSeason(event.target.value);
|
||||||
|
}
|
||||||
|
|
||||||
uncheckSelectAllBtn() {
|
uncheckSelectAllBtn() {
|
||||||
this.selectAllTarget.checked = false;
|
this.selectAllTarget.checked = false;
|
||||||
}
|
}
|
||||||
|
|||||||
51
assets/controllers/tv_episode_list_controller.js
Normal file
51
assets/controllers/tv_episode_list_controller.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { Controller } from '@hotwired/stimulus';
|
||||||
|
import { getComponent } from '@symfony/ux-live-component';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The following line makes this controller "lazy": it won't be downloaded until needed
|
||||||
|
* See https://symfony.com/bundles/StimulusBundle/current/index.html#lazy-stimulus-controllers
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* stimulusFetch: 'lazy' */
|
||||||
|
export default class extends Controller {
|
||||||
|
|
||||||
|
async initialize() {
|
||||||
|
this.component = await getComponent(this.element);
|
||||||
|
this.component.on('render:finished', (component) => {
|
||||||
|
console.log(component);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setSeason(season) {
|
||||||
|
this.element.querySelectorAll(".episode-container").forEach(element => element.remove());
|
||||||
|
this.component.set('pageNumber', 1);
|
||||||
|
this.component.set('season', parseInt(season));
|
||||||
|
this.component.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
paginate(event) {
|
||||||
|
this.element.querySelectorAll(".episode-container").forEach(element => element.remove());
|
||||||
|
this.component.action('paginate', {page: event.params.page});
|
||||||
|
this.component.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
connect() {
|
||||||
|
// Called every time the controller is connected to the DOM
|
||||||
|
// (on page load, when it's added to the DOM, moved in the DOM, etc.)
|
||||||
|
|
||||||
|
// Here you can add event listeners on the element or target elements,
|
||||||
|
// add or remove classes, attributes, dispatch custom events, etc.
|
||||||
|
// this.fooTarget.addEventListener('click', this._fooBar)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add custom controller actions here
|
||||||
|
// fooBar() { this.fooTarget.classList.toggle(this.bazClass) }
|
||||||
|
|
||||||
|
disconnect() {
|
||||||
|
// Called anytime its element is disconnected from the DOM
|
||||||
|
// (on page change, when it's removed from or moved in the DOM, etc.)
|
||||||
|
|
||||||
|
// Here you should remove all event listeners added in "connect()"
|
||||||
|
// this.fooTarget.removeEventListener('click', this._fooBar)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,18 +18,19 @@ export default class extends Controller {
|
|||||||
active: Boolean,
|
active: Boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
static targets = ['list', 'count', 'episodeSelector']
|
static targets = ['list', 'count', 'episodeSelector', 'toggleButton']
|
||||||
static outlets = ['loading-icon']
|
static outlets = ['loading-icon']
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
optionsLoaded = false
|
optionsLoaded = false
|
||||||
|
isOpen = false
|
||||||
|
|
||||||
async connect() {
|
async connect() {
|
||||||
await this.setOptions();
|
await this.setOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
async setOptions() {
|
async setOptions() {
|
||||||
if (true === this.activeValue && this.optionsLoaded === false) {
|
if (this.optionsLoaded === false) {
|
||||||
this.optionsLoaded = true;
|
this.optionsLoaded = true;
|
||||||
await fetch(`/torrentio/tvshows/${this.tmdbIdValue}/${this.imdbIdValue}/${this.seasonValue}/${this.episodeValue}`)
|
await fetch(`/torrentio/tvshows/${this.tmdbIdValue}/${this.imdbIdValue}/${this.seasonValue}/${this.episodeValue}`)
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
@@ -55,19 +56,13 @@ export default class extends Controller {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
async setActive() {
|
async setActive() {
|
||||||
this.activeValue = true;
|
|
||||||
this.element.classList.remove('hidden');
|
|
||||||
if (false === this.optionsLoaded) {
|
if (false === this.optionsLoaded) {
|
||||||
await this.setOptions();
|
await this.setOptions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async setInActive() {
|
async setInActive() {
|
||||||
this.activeValue = false;
|
|
||||||
// if (true === this.hasEpisodeSelectorTarget()) {
|
|
||||||
this.episodeSelectorTarget.checked = false;
|
this.episodeSelectorTarget.checked = false;
|
||||||
// }
|
|
||||||
this.element.classList.add('hidden');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive() {
|
isActive() {
|
||||||
@@ -85,7 +80,16 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
toggleList() {
|
toggleList() {
|
||||||
|
// if (!this.isOpen) {
|
||||||
|
// this.toggleButtonTarget.classList.add('rotate-180');
|
||||||
|
// this.toggleButtonTarget.classList.remove('-rotate-180');
|
||||||
|
// } else {
|
||||||
|
// this.toggleButtonTarget.classList.add('-rotate-180');
|
||||||
|
// this.toggleButtonTarget.classList.remove('rotate-180');
|
||||||
|
// }
|
||||||
this.listTarget.classList.toggle('hidden');
|
this.listTarget.classList.toggle('hidden');
|
||||||
|
this.toggleButtonTarget.classList.toggle('rotate-90');
|
||||||
|
this.toggleButtonTarget.classList.toggle('-rotate-90');
|
||||||
}
|
}
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ services:
|
|||||||
tty: true
|
tty: true
|
||||||
environment:
|
environment:
|
||||||
TZ: America/Chicago
|
TZ: America/Chicago
|
||||||
command: php /app/bin/console messenger:consume async -vv --time-limit=3600 --limit=10
|
command: php /app/bin/console messenger:consume media_cache -vv --time-limit=3600
|
||||||
|
|
||||||
|
|
||||||
scheduler:
|
scheduler:
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Download\Framework\Repository\DownloadRepository;
|
use App\Download\Framework\Repository\DownloadRepository;
|
||||||
|
use App\Monitor\Action\Command\MonitorTvShowCommand;
|
||||||
|
use App\Monitor\Action\Handler\MonitorTvShowHandler;
|
||||||
use App\Tmdb\Tmdb;
|
use App\Tmdb\Tmdb;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -13,6 +15,7 @@ final class IndexController extends AbstractController
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Tmdb $tmdb,
|
private readonly Tmdb $tmdb,
|
||||||
|
private readonly MonitorTvShowHandler $monitorTvShowHandler,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[Route('/', name: 'app_index')]
|
#[Route('/', name: 'app_index')]
|
||||||
@@ -25,4 +28,11 @@ final class IndexController extends AbstractController
|
|||||||
'popular_tvshows' => $this->tmdb->popularTvShows(1, 6),
|
'popular_tvshows' => $this->tmdb->popularTvShows(1, 6),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/test', name: 'app_test')]
|
||||||
|
public function test()
|
||||||
|
{
|
||||||
|
$result = $this->monitorTvShowHandler->handle(new MonitorTvShowCommand(355));
|
||||||
|
return $this->json($result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,13 +33,14 @@ final class SearchController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/result/{mediaType}/{imdbId}', name: 'app_search_result')]
|
#[Route('/result/{mediaType}/{imdbId}/{season}', name: 'app_search_result')]
|
||||||
public function result(
|
public function result(
|
||||||
GetMediaInfoInput $input,
|
GetMediaInfoInput $input,
|
||||||
|
?int $season = null,
|
||||||
): Response {
|
): Response {
|
||||||
$result = $this->getMediaInfoHandler->handle($input->toCommand());
|
$result = $this->getMediaInfoHandler->handle($input->toCommand());
|
||||||
|
|
||||||
$this->warmDownloadOptionCache($result->media);
|
// $this->warmDownloadOptionCache($result->media);
|
||||||
|
|
||||||
return $this->render('search/result.html.twig', [
|
return $this->render('search/result.html.twig', [
|
||||||
'results' => $result,
|
'results' => $result,
|
||||||
|
|||||||
@@ -52,13 +52,13 @@ final class TorrentioController extends AbstractController
|
|||||||
$input->episode,
|
$input->episode,
|
||||||
);
|
);
|
||||||
|
|
||||||
// return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
||||||
// $item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
||||||
$results = $this->getTvShowOptionsHandler->handle($input->toCommand());
|
$results = $this->getTvShowOptionsHandler->handle($input->toCommand());
|
||||||
return $this->render('torrentio/tvshows.html.twig', [
|
return $this->render('torrentio/tvshows.html.twig', [
|
||||||
'results' => $results,
|
'results' => $results,
|
||||||
]);
|
]);
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/torrentio/tvshows/clear/{tmdbId}/{imdbId}/{season?}/{episode?}', name: 'app_clear_torrentio_tvshows')]
|
#[Route('/torrentio/tvshows/clear/{tmdbId}/{imdbId}/{season?}/{episode?}', name: 'app_clear_torrentio_tvshows')]
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use App\Monitor\Framework\Entity\Monitor;
|
|||||||
use App\Monitor\Framework\Repository\MonitorRepository;
|
use App\Monitor\Framework\Repository\MonitorRepository;
|
||||||
use App\Monitor\Service\MediaFiles;
|
use App\Monitor\Service\MediaFiles;
|
||||||
use App\Tmdb\Tmdb;
|
use App\Tmdb\Tmdb;
|
||||||
|
use Carbon\Carbon;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Nihilarr\PTN;
|
use Nihilarr\PTN;
|
||||||
@@ -55,9 +56,18 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] Found ' . count($episodesInShow) . ' episodes for title: ' . $monitor->getTitle());
|
$this->logger->info('> [MonitorTvShowHandler] Found ' . count($episodesInShow) . ' episodes for title: ' . $monitor->getTitle());
|
||||||
|
|
||||||
|
$episodeMonitors = [];
|
||||||
if ($downloadedEpisodes->count() !== $episodesInShow->count()) {
|
if ($downloadedEpisodes->count() !== $episodesInShow->count()) {
|
||||||
// Dispatch Episode commands for each missing Episode
|
// Dispatch Episode commands for each missing Episode
|
||||||
foreach ($episodesInShow as $episode) {
|
foreach ($episodesInShow as $episode) {
|
||||||
|
// Only monitor future episodes
|
||||||
|
$episodeInFuture = $this->episodeInFuture($episode);
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] Episode is in future for season ' . $episode['season_number'] . ' episode ' . $episode['episode_number'] . ' for title: ' . $monitor->getTitle() . ' ? ' . (true === $episodeInFuture ? 'YES' : 'NO'));
|
||||||
|
if (false === $episodeInFuture) {
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] Episode not in future for title: ' . 'for season ' . $episode['season_number'] . ' episode ' . $episode['episode_number'] . ', skipping');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the episode is already downloaded
|
// Check if the episode is already downloaded
|
||||||
$episodeExists = $this->episodeExists($episode, $downloadedEpisodes);
|
$episodeExists = $this->episodeExists($episode, $downloadedEpisodes);
|
||||||
$this->logger->info('> [MonitorTvShowHandler] Episode exists for season ' . $episode['season_number'] . ' episode ' . $episode['episode_number'] . ' for title: ' . $monitor->getTitle() . ' ? ' . (true === $episodeExists ? 'YES' : 'NO'));
|
$this->logger->info('> [MonitorTvShowHandler] Episode exists for season ' . $episode['season_number'] . ' episode ' . $episode['episode_number'] . ' for title: ' . $monitor->getTitle() . ' ? ' . (true === $episodeExists ? 'YES' : 'NO'));
|
||||||
@@ -91,6 +101,8 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
$this->monitorRepository->getEntityManager()->persist($episodeMonitor);
|
$this->monitorRepository->getEntityManager()->persist($episodeMonitor);
|
||||||
$this->monitorRepository->getEntityManager()->flush();
|
$this->monitorRepository->getEntityManager()->flush();
|
||||||
|
|
||||||
|
$episodeMonitors[] = $episodeMonitor;
|
||||||
|
|
||||||
// Immediately run the monitor
|
// Immediately run the monitor
|
||||||
$command = new MonitorTvEpisodeCommand($episodeMonitor->getId());
|
$command = new MonitorTvEpisodeCommand($episodeMonitor->getId());
|
||||||
$this->monitorTvEpisodeHandler->handle($command);
|
$this->monitorTvEpisodeHandler->handle($command);
|
||||||
@@ -108,10 +120,18 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
status: 'OK',
|
status: 'OK',
|
||||||
result: [
|
result: [
|
||||||
'monitor' => $monitor,
|
'monitor' => $monitor,
|
||||||
|
'new_monitors' => $episodeMonitors,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function episodeInFuture(array $episodeInShow): bool
|
||||||
|
{
|
||||||
|
static $today = Carbon::today();
|
||||||
|
$episodeAirDate = Carbon::parse($episodeInShow['air_date']);
|
||||||
|
return $episodeAirDate > $today;
|
||||||
|
}
|
||||||
|
|
||||||
private function episodeExists(array $episodeInShow, Map $downloadedEpisodes): bool
|
private function episodeExists(array $episodeInShow, Map $downloadedEpisodes): bool
|
||||||
{
|
{
|
||||||
return $downloadedEpisodes->filter(
|
return $downloadedEpisodes->filter(
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ class GetMediaInfoCommand implements CommandInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
public string $imdbId,
|
public string $imdbId,
|
||||||
public string $mediaType,
|
public string $mediaType,
|
||||||
|
public ?int $season = null,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,6 @@ class GetMediaInfoHandler implements HandlerInterface
|
|||||||
{
|
{
|
||||||
$media = $this->tmdb->mediaDetails($command->imdbId, $command->mediaType);
|
$media = $this->tmdb->mediaDetails($command->imdbId, $command->mediaType);
|
||||||
|
|
||||||
return new GetMediaInfoResult($media);
|
return new GetMediaInfoResult($media, $command->season);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Search\Action\Input;
|
namespace App\Search\Action\Input;
|
||||||
|
|
||||||
use App\Download\Action\Command\DownloadMediaCommand;
|
use App\Download\Action\Command\DownloadMediaCommand;
|
||||||
|
use App\Enum\MediaType;
|
||||||
use App\Search\Action\Command\GetMediaInfoCommand;
|
use App\Search\Action\Command\GetMediaInfoCommand;
|
||||||
use OneToMany\RichBundle\Attribute\SourceRoute;
|
use OneToMany\RichBundle\Attribute\SourceRoute;
|
||||||
use OneToMany\RichBundle\Contract\CommandInterface;
|
use OneToMany\RichBundle\Contract\CommandInterface;
|
||||||
@@ -17,10 +18,16 @@ class GetMediaInfoInput implements InputInterface
|
|||||||
|
|
||||||
#[SourceRoute('mediaType')]
|
#[SourceRoute('mediaType')]
|
||||||
public string $mediaType,
|
public string $mediaType,
|
||||||
|
|
||||||
|
#[SourceRoute('season', nullify: true)]
|
||||||
|
public ?int $season,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function toCommand(): CommandInterface
|
public function toCommand(): CommandInterface
|
||||||
{
|
{
|
||||||
return new GetMediaInfoCommand($this->imdbId, $this->mediaType);
|
if ("tvshows" === $this->mediaType && null === $this->season) {
|
||||||
|
$this->season = 1;
|
||||||
|
}
|
||||||
|
return new GetMediaInfoCommand($this->imdbId, $this->mediaType, $this->season);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,5 +10,6 @@ class GetMediaInfoResult implements ResultInterface
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public TmdbResult $media,
|
public TmdbResult $media,
|
||||||
|
public ?int $season,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|||||||
65
src/Search/TvEpisodePaginator.php
Normal file
65
src/Search/TvEpisodePaginator.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Search;
|
||||||
|
|
||||||
|
use App\Search\Action\Command\GetMediaInfoCommand;
|
||||||
|
use App\Search\Action\Handler\GetMediaInfoHandler;
|
||||||
|
use App\Search\Action\Result\GetMediaInfoResult;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
|
class TvEpisodePaginator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
private $total;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
private $lastPage;
|
||||||
|
|
||||||
|
private $items;
|
||||||
|
|
||||||
|
public $limit = 20;
|
||||||
|
|
||||||
|
public $currentPage = 1;
|
||||||
|
|
||||||
|
public function paginate(GetMediaInfoResult $results, int $page = 1, int $limit = 20): static
|
||||||
|
{
|
||||||
|
$this->total = count($results->media->episodes[$results->season]);
|
||||||
|
$this->lastPage = (int) ceil($this->total / $limit);
|
||||||
|
$this->items = array_slice($results->media->episodes[$results->season], ($page - 1) * $limit, $limit);
|
||||||
|
$this->currentPage = $page;
|
||||||
|
$this->limit = $limit;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTotal(): int
|
||||||
|
{
|
||||||
|
return $this->total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLastPage(): int
|
||||||
|
{
|
||||||
|
return $this->lastPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getItems()
|
||||||
|
{
|
||||||
|
return $this->items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getShowing()
|
||||||
|
{
|
||||||
|
$showingStart = (($this->currentPage - 1) * $this->limit) + 1;
|
||||||
|
$showingEnd = (($this->currentPage - 1) * $this->limit) + $this->limit;
|
||||||
|
|
||||||
|
if ($showingEnd > $this->total) {
|
||||||
|
$showingEnd = $this->total;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sprintf("Showing %d - %d of %d results.", $showingStart, $showingEnd, $this->total);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Tmdb;
|
namespace App\Tmdb;
|
||||||
|
|
||||||
|
use Aimeos\Map;
|
||||||
use App\Enum\MediaType;
|
use App\Enum\MediaType;
|
||||||
use App\ValueObject\ResultFactory;
|
use App\ValueObject\ResultFactory;
|
||||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||||
@@ -97,6 +98,16 @@ class Tmdb
|
|||||||
return $this->parseResult($movies[$movie], "movie");
|
return $this->parseResult($movies[$movie], "movie");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$movies = Map::from($movies->toArray())->filter(function ($movie) {
|
||||||
|
return $movie !== null
|
||||||
|
&& $movie->imdbId !== null
|
||||||
|
&& $movie->tmdbId !== null
|
||||||
|
&& $movie->title !== null
|
||||||
|
&& $movie->poster !== null
|
||||||
|
&& $movie->description !== null
|
||||||
|
&& $movie->mediaType !== null;
|
||||||
|
});
|
||||||
|
|
||||||
$movies = array_values($movies->toArray());
|
$movies = array_values($movies->toArray());
|
||||||
|
|
||||||
if (null !== $limit) {
|
if (null !== $limit) {
|
||||||
@@ -114,6 +125,16 @@ class Tmdb
|
|||||||
return $this->parseResult($movies[$movie], "movie");
|
return $this->parseResult($movies[$movie], "movie");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$movies = Map::from($movies->toArray())->filter(function ($movie) {
|
||||||
|
return $movie !== null
|
||||||
|
&& $movie->imdbId !== null
|
||||||
|
&& $movie->tmdbId !== null
|
||||||
|
&& $movie->title !== null
|
||||||
|
&& $movie->poster !== null
|
||||||
|
&& $movie->description !== null
|
||||||
|
&& $movie->mediaType !== null;
|
||||||
|
});
|
||||||
|
|
||||||
$movies = array_values($movies->toArray());
|
$movies = array_values($movies->toArray());
|
||||||
|
|
||||||
if (null !== $limit) {
|
if (null !== $limit) {
|
||||||
|
|||||||
44
src/Twig/Components/TvEpisodeList.php
Normal file
44
src/Twig/Components/TvEpisodeList.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Twig\Components;
|
||||||
|
|
||||||
|
use App\Search\Action\Command\GetMediaInfoCommand;
|
||||||
|
use App\Search\Action\Handler\GetMediaInfoHandler;
|
||||||
|
use App\Search\TvEpisodePaginator;
|
||||||
|
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
|
||||||
|
use Symfony\UX\LiveComponent\Attribute\LiveProp;
|
||||||
|
use Symfony\UX\LiveComponent\DefaultActionTrait;
|
||||||
|
|
||||||
|
#[AsLiveComponent]
|
||||||
|
final class TvEpisodeList
|
||||||
|
{
|
||||||
|
use DefaultActionTrait;
|
||||||
|
use PaginateTrait;
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public string $title = "";
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public string $imdbId = "";
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public string $tmdbId = "";
|
||||||
|
|
||||||
|
#[LiveProp(writable: true)]
|
||||||
|
public int $season = 1;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
private GetMediaInfoHandler $getMediaInfoHandler,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function getEpisodes()
|
||||||
|
{
|
||||||
|
$results = $this->getMediaInfoHandler->handle(new GetMediaInfoCommand($this->imdbId, "tvshows", $this->season));
|
||||||
|
return new TvEpisodePaginator()->paginate($results, $this->pageNumber, $this->perPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPage(int $page)
|
||||||
|
{
|
||||||
|
$this->pageNumber = $page;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ use App\Monitor\Framework\Entity\Monitor;
|
|||||||
use App\Monitor\Service\MediaFiles;
|
use App\Monitor\Service\MediaFiles;
|
||||||
use ChrisUllyott\FileSize;
|
use ChrisUllyott\FileSize;
|
||||||
use Twig\Attribute\AsTwigFilter;
|
use Twig\Attribute\AsTwigFilter;
|
||||||
|
use Twig\Attribute\AsTwigFunction;
|
||||||
|
|
||||||
class UtilExtension
|
class UtilExtension
|
||||||
{
|
{
|
||||||
@@ -14,6 +15,12 @@ class UtilExtension
|
|||||||
private readonly MediaFiles $mediaFiles,
|
private readonly MediaFiles $mediaFiles,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[AsTwigFunction('uniqid')]
|
||||||
|
public function uniqid(): string
|
||||||
|
{
|
||||||
|
return uniqid();
|
||||||
|
}
|
||||||
|
|
||||||
#[AsTwigFilter('filesize')]
|
#[AsTwigFilter('filesize')]
|
||||||
public function type(string|int $size)
|
public function type(string|int $size)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class Paginator
|
|||||||
|
|
||||||
public $currentPage = 1;
|
public $currentPage = 1;
|
||||||
|
|
||||||
|
public $limit = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param QueryBuilder|Query $query
|
* @param QueryBuilder|Query $query
|
||||||
* @param int $page
|
* @param int $page
|
||||||
@@ -41,6 +43,7 @@ class Paginator
|
|||||||
$this->lastPage = (int) ceil($paginator->count() / $paginator->getQuery()->getMaxResults());
|
$this->lastPage = (int) ceil($paginator->count() / $paginator->getQuery()->getMaxResults());
|
||||||
$this->items = $paginator;
|
$this->items = $paginator;
|
||||||
$this->currentPage = $page;
|
$this->currentPage = $page;
|
||||||
|
$this->limit = $limit;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -59,4 +62,11 @@ class Paginator
|
|||||||
{
|
{
|
||||||
return $this->items;
|
return $this->items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getShowing()
|
||||||
|
{
|
||||||
|
$showingStart = ($this->currentPage - 1) * $this->limit;
|
||||||
|
$showingEnd = $showingStart + $this->limit;
|
||||||
|
return sprintf("Showing %d - %d of %d results.", $showingStart, $showingEnd, $this->total);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,9 @@ module.exports = {
|
|||||||
"bg-orange-400",
|
"bg-orange-400",
|
||||||
"bg-blue-600",
|
"bg-blue-600",
|
||||||
"bg-rose-600",
|
"bg-rose-600",
|
||||||
|
"min-w-64",
|
||||||
|
"rotate-180",
|
||||||
|
"-rotate-180",
|
||||||
"transition-opacity",
|
"transition-opacity",
|
||||||
"ease-in",
|
"ease-in",
|
||||||
"duration-700",
|
"duration-700",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
data-result-filter-media-type-value="{{ results.media.mediaType }}"
|
data-result-filter-media-type-value="{{ results.media.mediaType }}"
|
||||||
data-result-filter-movie-results-outlet=".results"
|
data-result-filter-movie-results-outlet=".results"
|
||||||
data-result-filter-tv-results-outlet=".results"
|
data-result-filter-tv-results-outlet=".results"
|
||||||
|
data-result-filter-tv-episode-list-outlet=".episode-list"
|
||||||
>
|
>
|
||||||
<div class="w-full p-4 flex flex-row gap-4 bg-stone-500 text-md text-gray-500 dark:text-gray-50 rounded-lg">
|
<div class="w-full p-4 flex flex-row gap-4 bg-stone-500 text-md text-gray-500 dark:text-gray-50 rounded-lg">
|
||||||
<label for="resolution">
|
<label for="resolution">
|
||||||
@@ -58,7 +59,9 @@
|
|||||||
<label for="season">
|
<label for="season">
|
||||||
Season
|
Season
|
||||||
<select id="season" name="season" value="1" data-result-filter-target="season" class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
|
<select id="season" name="season" value="1" data-result-filter-target="season" class="px-1 py-0.5 bg-stone-100 text-gray-800 rounded-md"
|
||||||
{{ stimulus_action('result_filter', 'uncheckSelectAllBtn', 'change') }}>
|
{{ stimulus_action('result_filter', 'setSeason', 'change') }}
|
||||||
|
{{ stimulus_action('result_filter', 'uncheckSelectAllBtn', 'change') }}
|
||||||
|
>
|
||||||
<option selected value="1">1</option>
|
<option selected value="1">1</option>
|
||||||
{% for season in range(2, results.media.episodes|length) %}
|
{% for season in range(2, results.media.episodes|length) %}
|
||||||
<option value="{{ season }}">{{ season }}</option>
|
<option value="{{ season }}">{{ season }}</option>
|
||||||
|
|||||||
27
templates/components/TvEpisodeList.html.twig
Normal file
27
templates/components/TvEpisodeList.html.twig
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<div{{ attributes.defaults(stimulus_controller('tv_episode_list')) }}
|
||||||
|
class="episode-list flex flex-col gap-4"
|
||||||
|
>
|
||||||
|
<div data-live-id="{{ uniqid() }}" class="episode-container flex flex-col gap-4">
|
||||||
|
{% for episode in this.episodes.items %}
|
||||||
|
<div id="episode_{{ episode['season_number'] }}_{{ episode['episode_number'] }}" class="results"
|
||||||
|
data-tv-results-loading-icon-outlet=".loading-icon"
|
||||||
|
data-download-button-outlet=".download-btn"
|
||||||
|
{{ stimulus_controller('tv_results', {
|
||||||
|
title: this.title,
|
||||||
|
tmdbId: this.tmdbId,
|
||||||
|
imdbId: this.imdbId,
|
||||||
|
season: episode['season_number'],
|
||||||
|
episode: episode['episode_number'],
|
||||||
|
active: 'true',
|
||||||
|
}) }}></div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% set paginator = this.episodes %}
|
||||||
|
{% include 'partial/tv-episode-list-paginator.html.twig' %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% macro placeholder(props) %}
|
||||||
|
<span>
|
||||||
|
<twig:ux:icon name="codex:loader" height="40" width="40" data-loading-icon-target="icon" class="text-end" />
|
||||||
|
</span>
|
||||||
|
{% endmacro %}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{% set _currentPage = paginator.currentPage ?: 1 %}
|
{% set _currentPage = paginator.currentPage ?: 1 %}
|
||||||
{% set _lastPage = paginator.lastPage %}
|
{% set _lastPage = paginator.lastPage %}
|
||||||
{% set _showingPerPage = (_currentPage == _lastPage) ? paginator.total - (this.perPage * (_lastPage - 1)) : paginator.items.query.maxResults %}
|
{% set _showingPerPage = (_currentPage == _lastPage) ? paginator.total - (this.perPage * (_lastPage - 1)) : ("query" in paginator.items) ? paginator.items.query.maxResults %}
|
||||||
|
|
||||||
<p class="text-white mt-1">Showing {{ _showingPerPage }} of {{ paginator.total }} total results</p>
|
<p class="text-white mt-1">Showing {{ _showingPerPage }} of {{ paginator.total }} total results</p>
|
||||||
|
|
||||||
@@ -8,75 +8,74 @@
|
|||||||
<nav>
|
<nav>
|
||||||
<ul class="mt-2 flex flex-row justify-content-center gap-1 py-1 text-white text-sm">
|
<ul class="mt-2 flex flex-row justify-content-center gap-1 py-1 text-white text-sm">
|
||||||
<li class="page-item{{ _currentPage <= 1 ? ' disabled' : '' }}">
|
<li class="page-item{{ _currentPage <= 1 ? ' disabled' : '' }}">
|
||||||
<a {% if _currentPage > 1 %}
|
<button {% if _currentPage > 1 %}
|
||||||
data-action="click->live#action"
|
data-action="click->live#action"
|
||||||
data-live-action-param="paginate"
|
data-live-action-param="paginate"
|
||||||
data-live-page-param="{{ _currentPage - 1 }}"
|
data-live-page-param="{{ _currentPage - 1 }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
aria-label="Previous"
|
aria-label="Previous"
|
||||||
href="#"
|
|
||||||
>
|
>
|
||||||
«
|
«
|
||||||
</a>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
{% set startPage = max(1, _currentPage - 2) %}
|
{% set startPage = max(1, _currentPage - 2) %}
|
||||||
{% set endPage = min(_lastPage, startPage + 4) %}
|
{% set endPage = min(_lastPage, startPage + 4) %}
|
||||||
{% if startPage > 1 %}
|
{% if startPage > 1 %}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a data-action="click->live#action"
|
<button data-action="click->live#action"
|
||||||
data-live-action-param="paginate"
|
data-live-action-param="paginate"
|
||||||
data-live-page-param="{{ "1"|number_format }}"
|
data-live-page-param="{{ "1"|number_format }}"
|
||||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
aria-label="Next"
|
aria-label="Next"
|
||||||
href="#"
|
|
||||||
>1</a>
|
>1</button>
|
||||||
</li>
|
</li>
|
||||||
{% if startPage > 2 %}
|
{% if startPage > 2 %}
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle">...</span>
|
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle inline-flex items-stretch">...</span>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for i in startPage..endPage %}
|
{% for i in startPage..endPage %}
|
||||||
<li class="page-item}">
|
<li class="page-item">
|
||||||
<a data-action="click->live#action"
|
<button data-action="click->live#action"
|
||||||
data-live-action-param="paginate"
|
data-live-action-param="paginate"
|
||||||
data-live-page-param="{{ i|number_format }}"
|
data-live-page-param="{{ i|number_format }}"
|
||||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 text-white align-middle"
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 text-white align-middle"
|
||||||
{% if i == _currentPage %}style="background-color: #fff; color: darkorange; border: 2px solid darkorange;"{% endif %}
|
{% if i == _currentPage %}style="background-color: #fff; color: darkorange; font-weight: bold;"{% endif %}
|
||||||
href="#"
|
>{{ i }}</button>
|
||||||
>{{ i }}</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if endPage < _lastPage %}
|
{% if endPage < _lastPage %}
|
||||||
{% if endPage < _lastPage - 1 %}
|
{% if endPage < _lastPage - 1 %}
|
||||||
<li class="page-item disabled">
|
<li class="page-item disabled">
|
||||||
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle">...</span>
|
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle inline-flex items-stretch">...</span>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a data-action="click->live#action"
|
<button data-action="click->live#action"
|
||||||
data-live-action-param="paginate"
|
data-live-action-param="paginate"
|
||||||
data-live-page-param="{{ _lastPage }}"
|
data-live-page-param="{{ _lastPage }}"
|
||||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
aria-label="Next"
|
aria-label="Next"
|
||||||
href="#"
|
|
||||||
>{{ _lastPage }}</a>
|
>{{ _lastPage }}</button>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="page-item {{ _currentPage >= paginator.lastPage ? ' disabled' : '' }}">
|
<li class="page-item {{ _currentPage >= paginator.lastPage ? ' disabled' : '' }}">
|
||||||
<a {% if _currentPage < _lastPage %}
|
<button {% if _currentPage < _lastPage %}
|
||||||
data-action="click->live#action"
|
data-action="click->live#action"
|
||||||
data-live-action-param="paginate"
|
data-live-action-param="paginate"
|
||||||
data-live-page-param="{{ _currentPage + 1 }}"
|
data-live-page-param="{{ _currentPage + 1 }}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
aria-label="Next"
|
aria-label="Next"
|
||||||
href="#"
|
|
||||||
>
|
>
|
||||||
»
|
»
|
||||||
</a>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
74
templates/partial/tv-episode-list-paginator.html.twig
Normal file
74
templates/partial/tv-episode-list-paginator.html.twig
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{% set _currentPage = paginator.currentPage ?: 1 %}
|
||||||
|
{% set _lastPage = paginator.lastPage %}
|
||||||
|
{% set _showingPerPage = (_currentPage == _lastPage) ? paginator.total - (this.perPage * (_lastPage - 1)) : ("query" in paginator.items) ? paginator.items.query.maxResults %}
|
||||||
|
|
||||||
|
<p class="text-white mt-1">{{ paginator.getShowing() }}</p>
|
||||||
|
|
||||||
|
{% if paginator.lastPage > 1 %}
|
||||||
|
<nav>
|
||||||
|
<ul class="mt-2 flex flex-row justify-content-center gap-1 py-1 text-white text-sm">
|
||||||
|
<li class="page-item{{ _currentPage <= 1 ? ' disabled' : '' }}">
|
||||||
|
<button
|
||||||
|
{% if _currentPage > 1 %}
|
||||||
|
{{ stimulus_action('tv-episode-list', 'paginate', 'click', {page: _currentPage - 1}) }}
|
||||||
|
{% endif %}
|
||||||
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
|
aria-label="Previous"
|
||||||
|
>
|
||||||
|
«
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
{% set startPage = max(1, _currentPage - 2) %}
|
||||||
|
{% set endPage = min(_lastPage, startPage + 4) %}
|
||||||
|
{% if startPage > 1 %}
|
||||||
|
<li class="page-item">
|
||||||
|
<button
|
||||||
|
{{ stimulus_action('tv-episode-list', 'paginate', 'click', {page: 1}) }}
|
||||||
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
|
aria-label="Next"
|
||||||
|
|
||||||
|
>1</button>
|
||||||
|
</li>
|
||||||
|
{% if startPage > 2 %}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle inline-flex items-stretch">...</span>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% for i in startPage..endPage %}
|
||||||
|
<li class="page-item">
|
||||||
|
<button
|
||||||
|
{{ stimulus_action('tv-episode-list', 'paginate', 'click', {page: i}) }}
|
||||||
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 text-white align-middle"
|
||||||
|
{% if i == _currentPage %}style="background-color: #fff; color: darkorange; font-weight: bold;"{% endif %}
|
||||||
|
>{{ i }}</button>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
{% if endPage < _lastPage %}
|
||||||
|
{% if endPage < _lastPage - 1 %}
|
||||||
|
<li class="page-item disabled">
|
||||||
|
<span class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle inline-flex items-stretch">...</span>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item">
|
||||||
|
<button
|
||||||
|
{{ stimulus_action('tv-episode-list', 'paginate', 'click', {page: _lastPage}) }}
|
||||||
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
|
aria-label="Next"
|
||||||
|
>{{ _lastPage }}</button>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
<li class="page-item {{ _currentPage >= paginator.lastPage ? ' disabled' : '' }}">
|
||||||
|
<button
|
||||||
|
{% if _currentPage < _lastPage %}
|
||||||
|
{{ stimulus_action('tv-episode-list', 'paginate', 'click', {page: _currentPage + 1}) }}
|
||||||
|
{% endif %}
|
||||||
|
class="page-link px-2.5 py-1 rounded-lg bg-orange-500 align-middle"
|
||||||
|
aria-label="Next"
|
||||||
|
>
|
||||||
|
»
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{% endif %}
|
||||||
@@ -118,22 +118,10 @@
|
|||||||
<div class="results" {{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}>
|
<div class="results" {{ stimulus_controller('movie_results', {title: results.media.title, tmdbId: results.media.tmdbId, imdbId: results.media.imdbId}) }}>
|
||||||
</div>
|
</div>
|
||||||
{% elseif "tvshows" == results.media.mediaType %}
|
{% elseif "tvshows" == results.media.mediaType %}
|
||||||
{% for season, episodes in results.media.episodes %}
|
<twig:TvEpisodeList
|
||||||
{% set active = (season == '1') ? true : false %}
|
:imdbId="results.media.imdbId" :season="results.season" :perPage="20" :pageNumber="1"
|
||||||
{% for episode in episodes %}
|
:tmdbId="results.media.tmdbId" :title="results.media.title" loading="defer"
|
||||||
<div class="results {{ (active == false) ? 'hidden' }}"
|
/>
|
||||||
data-tv-results-loading-icon-outlet=".loading-icon"
|
|
||||||
data-download-button-outlet=".download-btn"
|
|
||||||
{{ stimulus_controller('tv_results', {
|
|
||||||
title: results.media.title,
|
|
||||||
tmdbId: results.media.tmdbId,
|
|
||||||
imdbId: results.media.imdbId,
|
|
||||||
season: season,
|
|
||||||
episode: episode['episode_number'],
|
|
||||||
active: active,
|
|
||||||
}) }}></div>
|
|
||||||
{% endfor %}
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</twig:Card>
|
</twig:Card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{% if results.media.poster != null %}
|
{% if results.media.poster != null %}
|
||||||
<img class="w-64 rounded-lg" src="{{ results.media.poster }}" />
|
<img class="w-64 rounded-lg" src="{{ results.media.poster }}" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="w-64 h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
<div class="w-64 min-w-64 sticky h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
||||||
<twig:ux:icon width="32" name="hugeicons:loading-01" />
|
<twig:ux:icon width="32" name="hugeicons:loading-01" />
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -58,10 +58,20 @@
|
|||||||
{{ stimulus_target('tv-results', 'episodeSelector') }}
|
{{ stimulus_target('tv-results', 'episodeSelector') }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button class="flex flex-col items-end"
|
<button class="flex flex-col items-end transition-transform duration-300 ease-in-out rotate-90"
|
||||||
|
{{ stimulus_target('tv-results', 'toggleButton') }}
|
||||||
{{ stimulus_action('tv-results', 'toggleList', 'click') }}>
|
{{ stimulus_action('tv-results', 'toggleList', 'click') }}>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" viewBox="0 0 32 32">
|
{# <svg xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" viewBox="0 0 32 32">#}
|
||||||
<path fill="currentColor" d="m16 10l10 10l-1.4 1.4l-8.6-8.6l-8.6 8.6L6 20z"/>
|
{# <path fill="currentColor" d="m16 10l10 10l-1.4 1.4l-8.6-8.6l-8.6 8.6L6 20z"/>#}
|
||||||
|
{# </svg>#}
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32">
|
||||||
|
<path
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M20 6L10 16l10 10" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user