Compare commits
12 Commits
v0.34.3
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
| a978469564 | |||
| 3097189c49 | |||
| 6f11de70e0 | |||
| 4e06fe6636 | |||
| fd46abf58f | |||
| 2237a45d6f | |||
| 846de2c257 | |||
| d01b725435 | |||
| 7562597629 | |||
| deb0333635 | |||
| c8e190f9e8 | |||
| 538fde40fe |
@@ -13,34 +13,7 @@ export default class extends Controller {
|
|||||||
tmdbId: String,
|
tmdbId: String,
|
||||||
imdbId: String,
|
imdbId: String,
|
||||||
title: String,
|
title: String,
|
||||||
}
|
season: Number,
|
||||||
|
|
||||||
initialize() {
|
|
||||||
// Called once when the controller is first instantiated (per element)
|
|
||||||
|
|
||||||
// Here you can initialize variables, create scoped callables for event
|
|
||||||
// listeners, instantiate external libraries, etc.
|
|
||||||
// this._fooBar = this.fooBar.bind(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
@@ -53,34 +26,13 @@ export default class extends Controller {
|
|||||||
imdbId: this.imdbIdValue,
|
imdbId: this.imdbIdValue,
|
||||||
title: this.titleValue,
|
title: this.titleValue,
|
||||||
monitorType: 'tvshows',
|
monitorType: 'tvshows',
|
||||||
|
season: this.seasonValue
|
||||||
});
|
});
|
||||||
if (this.hasDialogOutlet) {
|
if (this.hasDialogOutlet) {
|
||||||
this.dialogOutlet.close();
|
this.dialogOutlet.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async monitorSeason() {
|
|
||||||
await this.makeMonitor({
|
|
||||||
tmdbId: this.tmdbIdValue,
|
|
||||||
imdbId: this.imdbIdValue,
|
|
||||||
title: this.titleValue,
|
|
||||||
monitorType: 'tvseason',
|
|
||||||
season: this.resultFilterOutlet.activeFilter['season'],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async monitorEpisode() {
|
|
||||||
// ToDo: figure out how to set episode
|
|
||||||
await this.makeMonitor({
|
|
||||||
tmdbId: this.tmdbIdValue,
|
|
||||||
imdbId: this.imdbIdValue,
|
|
||||||
title: this.titleValue,
|
|
||||||
monitorType: 'tvepisode',
|
|
||||||
season: this.resultFilterOutlet.activeFilter['season'],
|
|
||||||
episode: '',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async makeMonitor(body) {
|
async makeMonitor(body) {
|
||||||
const response = await fetch('/api/monitor', {
|
const response = await fetch('/api/monitor', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -90,7 +42,6 @@ export default class extends Controller {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify(body)
|
body: JSON.stringify(body)
|
||||||
});
|
});
|
||||||
|
|
||||||
return await response.json();
|
return await response.json();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ services:
|
|||||||
- mercure_config:/config
|
- mercure_config:/config
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
logging:
|
|
||||||
driver: "gelf"
|
|
||||||
options:
|
|
||||||
gelf-address: "tcp://192.168.1.197:12202"
|
|
||||||
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
|
|||||||
@@ -42,13 +42,24 @@ readonly class MonitorTvEpisodeHandler implements HandlerInterface
|
|||||||
$monitor = $this->monitorRepository->find($command->movieMonitorId);
|
$monitor = $this->monitorRepository->find($command->movieMonitorId);
|
||||||
$this->logger->info('> [MonitorTvEpisodeHandler] Executing MonitorTvEpisodeHandler for ' . $monitor->getTitle() . ' season ' . $monitor->getSeason() . ' episode ' . $monitor->getEpisode());
|
$this->logger->info('> [MonitorTvEpisodeHandler] Executing MonitorTvEpisodeHandler for ' . $monitor->getTitle() . ' season ' . $monitor->getSeason() . ' episode ' . $monitor->getEpisode());
|
||||||
|
|
||||||
$episodeData = $this->tmdb->tvEpisodeDetails($monitor->getTmdbId(), $monitor->getSeason(), $monitor->getEpisode());
|
$episodeData = $this->tmdb->tvEpisodeDetails($monitor->getTmdbId(), $monitor->getImdbId(), $monitor->getSeason(), $monitor->getEpisode());
|
||||||
|
|
||||||
if (null === $monitor->getAirDate() && null !== $episodeData->episodeAirDate && "" !== $episodeData->episodeAirDate) {
|
if (null === $episodeData->airDate || "" === $episodeData->airDate) {
|
||||||
$monitor->setAirDate(Carbon::parse($episodeData->episodeAirDate));
|
$this->logger->info('> [MonitorTvEpisodeHandler] ...Episode does not have an air date, skipping for now');
|
||||||
|
return new MonitorTvEpisodeResult(
|
||||||
|
status: 'OK',
|
||||||
|
result: [
|
||||||
|
'message' => 'No change',
|
||||||
|
'monitor' => $monitor,
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Carbon::createFromTimestamp($episodeData->episodeAirDate) > Carbon::today('UTC')) {
|
if (null === $monitor->getAirDate()) {
|
||||||
|
$monitor->setAirDate(Carbon::parse($episodeData->airDate));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Carbon::createFromTimestamp($episodeData->airDate) > Carbon::today('UTC')) {
|
||||||
$this->logger->info('> [MonitorTvEpisodeHandler] ...Episode has not aired yet, skipping for now');
|
$this->logger->info('> [MonitorTvEpisodeHandler] ...Episode has not aired yet, skipping for now');
|
||||||
return new MonitorTvEpisodeResult(
|
return new MonitorTvEpisodeResult(
|
||||||
status: 'OK',
|
status: 'OK',
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
private MediaFiles $mediaFiles,
|
private MediaFiles $mediaFiles,
|
||||||
private LoggerInterface $logger,
|
private LoggerInterface $logger,
|
||||||
private TmdbClient $tmdb,
|
private TmdbClient $tmdb,
|
||||||
) {}
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
public function handle(CommandInterface $command): ResultInterface
|
public function handle(CommandInterface $command): ResultInterface
|
||||||
{
|
{
|
||||||
@@ -40,79 +41,77 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
// Check current episodes
|
// Check current episodes
|
||||||
$downloadedEpisodes = $this->mediaFiles
|
$downloadedEpisodes = $this->mediaFiles
|
||||||
->getEpisodes($monitor->getTitle())
|
->getEpisodes($monitor->getTitle())
|
||||||
->map(fn($episode) => (object) (new PTN())->parse($episode))
|
->map(fn($episode) => (object)(new PTN())->parse($episode))
|
||||||
->filter(fn ($episode) =>
|
->filter(fn($episode) => property_exists($episode, 'episode')
|
||||||
property_exists($episode, 'episode')
|
|
||||||
&& property_exists($episode, 'season')
|
&& property_exists($episode, 'season')
|
||||||
&& null !== $episode->episode
|
&& null !== $episode->episode
|
||||||
&& null !== $episode->season
|
&& null !== $episode->season
|
||||||
)
|
);
|
||||||
;
|
|
||||||
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] Found ' . count($downloadedEpisodes) . ' downloaded episodes for title: ' . $monitor->getTitle());
|
$this->logger->info('> [MonitorTvShowHandler] Found ' . count($downloadedEpisodes) . ' downloaded episodes for title: ' . $monitor->getTitle());
|
||||||
|
|
||||||
// Compare against list from TMDB
|
// Compare against list from TMDB
|
||||||
$episodesInShow = Map::from(
|
$episodesInShow = Map::from(
|
||||||
$this->tmdb->tvshowDetails($monitor->getImdbId())->episodes
|
$this->tmdb->tvshowDetails($monitor->getImdbId())->episodes
|
||||||
)->flat(1);
|
)->flat(1)
|
||||||
|
->filter(fn(TmdbEpisodeDto $episode) => $episode->seasonNumber >= $monitor->getSeason())
|
||||||
|
->values();
|
||||||
|
|
||||||
$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 = [];
|
$episodeMonitors = [];
|
||||||
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) {
|
/** @var TmdbEpisodeDto $episode */
|
||||||
/** @var TmdbEpisodeDto $episode */
|
// Only monitor future episodes
|
||||||
// Only monitor future episodes
|
$this->logger->info('> [MonitorTvShowHandler] Evaluating "' . $monitor->getTitle() . '", season "' . $episode->seasonNumber . '" episode "' . $episode->episodeNumber . '"');
|
||||||
$this->logger->info('> [MonitorTvShowHandler] Evaluating "' . $monitor->getTitle() . '", season "' . $episode->seasonNumber . '" episode "' . $episode->episodeNumber . '"');
|
$episodeInFuture = $this->episodeReleasedAfterMonitorCreated($monitor->getCreatedAt(), $episode);
|
||||||
$episodeInFuture = $this->episodeReleasedAfterMonitorCreated($monitor->getCreatedAt(), $episode);
|
$this->logger->info('> [MonitorTvShowHandler] ...Released after monitor started? ' . (true === $episodeInFuture ? 'YES' : 'NO'));
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Released after monitor started? ' . (true === $episodeInFuture ? 'YES' : 'NO'));
|
if (false === $episodeInFuture) {
|
||||||
if (false === $episodeInFuture) {
|
$this->logger->info('> [MonitorTvShowHandler] ...Skipping');
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Skipping');
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the episode is already downloaded
|
|
||||||
$episodeExists = $this->episodeExists($episode, $downloadedEpisodes);
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Episode exists? ' . (true === $episodeExists ? 'YES' : 'NO'));
|
|
||||||
if (true === $episodeExists) {
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Skipping');
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for existing monitors
|
|
||||||
$monitorExists = $this->monitorExists($monitor, $episode);
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Monitor exists? ' . (true === $monitorExists ? 'YES' : 'NO'));
|
|
||||||
if (true === $monitorExists) {
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Skipping');
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the monitor
|
|
||||||
$episodeMonitor = (new Monitor())
|
|
||||||
->setParent($monitor)
|
|
||||||
->setUser($monitor->getUser())
|
|
||||||
->setTmdbId($monitor->getTmdbId())
|
|
||||||
->setImdbId($monitor->getImdbId())
|
|
||||||
->setTitle($monitor->getTitle())
|
|
||||||
->setMonitorType('tvepisode')
|
|
||||||
->setSeason($episode->seasonNumber)
|
|
||||||
->setEpisode($episode->episodeNumber)
|
|
||||||
->setAirDate($episode->airDate !== null && $episode->airDate !== "" ? Carbon::parse($episode->airDate) : null)
|
|
||||||
->setCreatedAt(new DateTimeImmutable())
|
|
||||||
->setSearchCount(0)
|
|
||||||
->setStatus('New');
|
|
||||||
|
|
||||||
$this->monitorRepository->getEntityManager()->persist($episodeMonitor);
|
|
||||||
$this->monitorRepository->getEntityManager()->flush();
|
|
||||||
|
|
||||||
$episodeMonitors[] = $episodeMonitor;
|
|
||||||
|
|
||||||
// Immediately run the monitor
|
|
||||||
$command = new MonitorTvEpisodeCommand($episodeMonitor->getId());
|
|
||||||
$this->monitorTvEpisodeHandler->handle($command);
|
|
||||||
$this->logger->info('> [MonitorTvShowHandler] ...Dispatching MonitorTvEpisodeCommand');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the episode is already downloaded
|
||||||
|
$episodeExists = $this->episodeExists($episode, $downloadedEpisodes);
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] ...Episode exists? ' . (true === $episodeExists ? 'YES' : 'NO'));
|
||||||
|
if (true === $episodeExists) {
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] ...Skipping');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for existing monitors
|
||||||
|
$monitorExists = $this->monitorExists($monitor, $episode);
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] ...Monitor exists? ' . (true === $monitorExists ? 'YES' : 'NO'));
|
||||||
|
if (true === $monitorExists) {
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] ...Skipping');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the monitor
|
||||||
|
$episodeMonitor = (new Monitor())
|
||||||
|
->setParent($monitor)
|
||||||
|
->setUser($monitor->getUser())
|
||||||
|
->setTmdbId($monitor->getTmdbId())
|
||||||
|
->setImdbId($monitor->getImdbId())
|
||||||
|
->setTitle($monitor->getTitle())
|
||||||
|
->setMonitorType('tvepisode')
|
||||||
|
->setSeason($episode->seasonNumber)
|
||||||
|
->setEpisode($episode->episodeNumber)
|
||||||
|
->setAirDate($episode->airDate !== null && $episode->airDate !== "" ? Carbon::parse($episode->airDate) : null)
|
||||||
|
->setCreatedAt(new DateTimeImmutable())
|
||||||
|
->setSearchCount(0)
|
||||||
|
->setStatus('New');
|
||||||
|
|
||||||
|
$this->monitorRepository->getEntityManager()->persist($episodeMonitor);
|
||||||
|
$this->monitorRepository->getEntityManager()->flush();
|
||||||
|
|
||||||
|
$episodeMonitors[] = $episodeMonitor;
|
||||||
|
|
||||||
|
// Immediately run the monitor
|
||||||
|
$command = new MonitorTvEpisodeCommand($episodeMonitor->getId());
|
||||||
|
$this->monitorTvEpisodeHandler->handle($command);
|
||||||
|
$this->logger->info('> [MonitorTvShowHandler] ...Dispatching MonitorTvEpisodeCommand');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the status to Active, so it will be re-executed.
|
// Set the status to Active, so it will be re-executed.
|
||||||
@@ -130,8 +129,10 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function episodeReleasedAfterMonitorCreated(string|DateTimeImmutable $monitorStartDate, TmdbEpisodeDto $episodeInShow): bool
|
private function episodeReleasedAfterMonitorCreated(
|
||||||
{
|
string|DateTimeImmutable $monitorStartDate,
|
||||||
|
TmdbEpisodeDto $episodeInShow
|
||||||
|
): bool {
|
||||||
$monitorStartDate = Carbon::parse($monitorStartDate)->setTime(0, 0);
|
$monitorStartDate = Carbon::parse($monitorStartDate)->setTime(0, 0);
|
||||||
$episodeAirDate = Carbon::parse($episodeInShow->airDate);
|
$episodeAirDate = Carbon::parse($episodeInShow->airDate);
|
||||||
return $episodeAirDate >= $monitorStartDate;
|
return $episodeAirDate >= $monitorStartDate;
|
||||||
@@ -140,8 +141,8 @@ readonly class MonitorTvShowHandler implements HandlerInterface
|
|||||||
private function episodeExists(TmdbEpisodeDto $episodeInShow, Map $downloadedEpisodes): bool
|
private function episodeExists(TmdbEpisodeDto $episodeInShow, Map $downloadedEpisodes): bool
|
||||||
{
|
{
|
||||||
return $downloadedEpisodes->filter(
|
return $downloadedEpisodes->filter(
|
||||||
fn (object $episode) => $episode->episode === $episodeInShow->episodeNumber
|
fn(object $episode) => $episode->episode === $episodeInShow->episodeNumber
|
||||||
&& $episode->season === $episodeInShow->seasonNumber
|
&& $episode->season === $episodeInShow->seasonNumber
|
||||||
)->count() > 0;
|
)->count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ class GetMediaInfoHandler implements HandlerInterface
|
|||||||
$handlers = [
|
$handlers = [
|
||||||
MediaType::Movie->value => 'getMovieDetails',
|
MediaType::Movie->value => 'getMovieDetails',
|
||||||
MediaType::TvShow->value => 'getTvshowDetails',
|
MediaType::TvShow->value => 'getTvshowDetails',
|
||||||
MediaType::TvEpisode->value => 'getTvshowDetails',
|
|
||||||
];
|
];
|
||||||
$handler = $handlers[$command->mediaType];
|
$handler = $handlers[$command->mediaType];
|
||||||
$media = $this->$handler($command);
|
$media = $this->$handler($command);
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ class TmdbTvShowResultDenormalizer extends TmdbResultDenormalizer implements Den
|
|||||||
$result->year = (null !== $airDate) ? $airDate->format('Y') : null;
|
$result->year = (null !== $airDate) ? $airDate->format('Y') : null;
|
||||||
$result->mediaType = MediaType::TvShow->value;
|
$result->mediaType = MediaType::TvShow->value;
|
||||||
|
|
||||||
|
if (is_array($result->episodes)) {
|
||||||
|
$result->latestSeason = array_key_last($result->episodes);
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,13 +170,13 @@ class TmdbClient
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tvEpisodeDetails(string $tmdbId, int $season, int $episode): TmdbResult|TmdbEpisodeDto|null
|
public function tvEpisodeDetails(string $tmdbId, string $showImdbId, int $season, int $episode): TmdbResult|TmdbEpisodeDto|null
|
||||||
{
|
{
|
||||||
$result = $this->tvEpisodeRepository->getApi()->getEpisode($tmdbId, $season, $episode, ['append_to_response' => 'external_ids,credits']);
|
$result = $this->tvEpisodeRepository->getApi()->getEpisode($tmdbId, $season, $episode, ['append_to_response' => 'external_ids,credits']);
|
||||||
return $this->parseResult(
|
return $this->parseResult(
|
||||||
$result,
|
$result,
|
||||||
MediaType::TvEpisode->value,
|
MediaType::TvEpisode->value,
|
||||||
$result['external_ids']['imdb_id']
|
$showImdbId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,5 +56,6 @@ class TmdbResult
|
|||||||
public ?array $producers = null,
|
public ?array $producers = null,
|
||||||
public ?int $runtime = null,
|
public ?int $runtime = null,
|
||||||
public ?int $numberSeasons = null,
|
public ?int $numberSeasons = null,
|
||||||
|
public ?int $latestSeason = null,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class GetTvShowOptionsHandler implements HandlerInterface
|
|||||||
|
|
||||||
public function handle(CommandInterface $command): ResultInterface
|
public function handle(CommandInterface $command): ResultInterface
|
||||||
{
|
{
|
||||||
$media = $this->tmdb->tvEpisodeDetails($command->tmdbId, $command->season, $command->episode);
|
$media = $this->tmdb->tvEpisodeDetails($command->tmdbId, $command->imdbId, $command->season, $command->episode);
|
||||||
$parentShow = $this->tmdb->tvshowDetails($command->imdbId);
|
$parentShow = $this->tmdb->tvshowDetails($command->imdbId);
|
||||||
$file = $this->mediaFiles->episodeExists($parentShow->title, $command->season, $command->episode);
|
$file = $this->mediaFiles->episodeExists($parentShow->title, $command->season, $command->episode);
|
||||||
|
|
||||||
|
|||||||
@@ -14,18 +14,10 @@
|
|||||||
>
|
>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 truncate">
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-stone-800 truncate">
|
||||||
<a href="{{ path('app_search_result', {imdbId: monitor.imdbId, mediaType: monitor.monitorType|as_download_type}) }}"
|
<a href="{{ path('app_search_result', {imdbId: monitor.imdbId, mediaType: monitor.monitorType|as_download_type}) }}"
|
||||||
class="mr-1 hover:underline rounded-md"
|
class="mr-1 hover:underline rounded-md">
|
||||||
>
|
{% set episodeIdDto = extract_from_episode_id(monitor|monitor_media_id) %}
|
||||||
|
{% set routeParams = {imdbId: monitor.imdbId, mediaType: monitor.monitorType|as_download_type, season: episodeIdDto.season} %}
|
||||||
{% if monitor.monitorType == "movies" %}
|
<a href="{{ path('app_search_result', routeParams) }}"
|
||||||
{% set routeParams = {imdbId: monitor.imdbId, mediaType: monitor.monitorType} %}
|
|
||||||
{% set route = path('app_search_result', routeParams) %}
|
|
||||||
{% else %}
|
|
||||||
{% set episodeIdDto = extract_from_episode_id(monitor|monitor_media_id) %}
|
|
||||||
{% set routeParams = {imdbId: monitor.imdbId, mediaType: monitor.monitorType, season: episodeIdDto.season, episode: episodeIdDto.episode} %}
|
|
||||||
{% set route = path('app_search_result', routeParams) ~ "#" ~ episode_anchor(episodeIdDto.season, episodeIdDto.episode) %}
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ route }}"
|
|
||||||
class="mr-1 hover:underline rounded-md max-w-[10ch] md:max-w-[unset] truncate dark:text-white">
|
class="mr-1 hover:underline rounded-md max-w-[10ch] md:max-w-[unset] truncate dark:text-white">
|
||||||
{{ monitor.title }}
|
{{ monitor.title }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
class="episode-list flex flex-col gap-4"
|
class="episode-list flex flex-col gap-4"
|
||||||
>
|
>
|
||||||
<div data-live-id="{{ uniqid() }}" class="episode-container flex flex-col gap-4">
|
<div data-live-id="{{ uniqid() }}" class="episode-container flex flex-col gap-4">
|
||||||
|
{% if this.getEpisodes().items != null %}
|
||||||
{% for episode in this.getEpisodes().items %}
|
{% for episode in this.getEpisodes().items %}
|
||||||
<episode-container id="{{ episode_anchor(episode.seasonNumber, episode.episodeNumber) }}" class="results"
|
<episode-container id="{{ episode_anchor(episode.seasonNumber, episode.episodeNumber) }}" class="results"
|
||||||
show-title="{{ this.title }}"
|
show-title="{{ this.title }}"
|
||||||
@@ -85,6 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</episode-container>
|
</episode-container>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% set paginator = this.episodes %}
|
{% set paginator = this.episodes %}
|
||||||
{% include 'partial/tv-episode-list-paginator.html.twig' %}
|
{% include 'partial/tv-episode-list-paginator.html.twig' %}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
tmdbId: results.media.tmdbId,
|
tmdbId: results.media.tmdbId,
|
||||||
imdbId: results.media.imdbId,
|
imdbId: results.media.imdbId,
|
||||||
title: results.media.title,
|
title: results.media.title,
|
||||||
|
season: results.media.latestSeason,
|
||||||
})}}
|
})}}
|
||||||
data-monitor-button-result-filter-outlet="#filter"
|
data-monitor-button-result-filter-outlet="#filter"
|
||||||
data-monitor-button-dialog-outlet=".monitor-modal"
|
data-monitor-button-dialog-outlet=".monitor-modal"
|
||||||
|
|||||||
Reference in New Issue
Block a user