Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98041fd20b | |||
| d29b84ec78 | |||
| ccce0303c3 |
@@ -56,6 +56,7 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let include = true;
|
let include = true;
|
||||||
|
option.classList.add('r-tablerow');
|
||||||
option.classList.remove('hidden');
|
option.classList.remove('hidden');
|
||||||
option.querySelector('input[type="checkbox"]').checked = false;
|
option.querySelector('input[type="checkbox"]').checked = false;
|
||||||
|
|
||||||
@@ -81,6 +82,7 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false === include) {
|
if (false === include) {
|
||||||
|
option.classList.remove('r-tablerow');
|
||||||
option.classList.add('hidden');
|
option.classList.add('hidden');
|
||||||
} else if (true === firstIncluded) {
|
} else if (true === firstIncluded) {
|
||||||
count = 1;
|
count = 1;
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let include = true;
|
let include = true;
|
||||||
|
option.classList.add('r-tablerow');
|
||||||
option.classList.remove('hidden');
|
option.classList.remove('hidden');
|
||||||
option.querySelector('input[type="checkbox"]').checked = false;
|
option.querySelector('input[type="checkbox"]').checked = false;
|
||||||
|
|
||||||
@@ -160,6 +161,7 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (false === include) {
|
if (false === include) {
|
||||||
|
option.classList.remove('r-tablerow');
|
||||||
option.classList.add('hidden');
|
option.classList.add('hidden');
|
||||||
} else if (true === firstIncluded) {
|
} else if (true === firstIncluded) {
|
||||||
count = 1;
|
count = 1;
|
||||||
|
|||||||
@@ -68,10 +68,18 @@ dialog[data-dialog-target="dialog"][closing] {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.r-tablerow {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
@media screen and (min-width: 768px) {
|
||||||
.r-tablecell {
|
.r-tablecell {
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.r-tablerow {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.options-table {
|
.options-table {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ 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\Command\MonitorTvShowCommand;
|
||||||
use App\Monitor\Action\Handler\MonitorTvShowHandler;
|
use App\Monitor\Action\Handler\MonitorTvShowHandler;
|
||||||
|
use App\Monitor\Framework\Scheduler\MonitorDispatcher;
|
||||||
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;
|
||||||
@@ -30,9 +31,9 @@ final class IndexController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/test', name: 'app_test')]
|
#[Route('/test', name: 'app_test')]
|
||||||
public function test()
|
public function test(MonitorDispatcher $dispatcher): Response
|
||||||
{
|
{
|
||||||
$result = $this->monitorTvShowHandler->handle(new MonitorTvShowCommand(355));
|
$dispatcher();
|
||||||
return $this->json($result);
|
return new Response();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ use App\Monitor\Action\Handler\AddMonitorHandler;
|
|||||||
use App\Monitor\Action\Handler\DeleteMonitorHandler;
|
use App\Monitor\Action\Handler\DeleteMonitorHandler;
|
||||||
use App\Monitor\Action\Input\AddMonitorInput;
|
use App\Monitor\Action\Input\AddMonitorInput;
|
||||||
use App\Monitor\Action\Input\DeleteMonitorInput;
|
use App\Monitor\Action\Input\DeleteMonitorInput;
|
||||||
|
use App\Monitor\Framework\Scheduler\MonitorDispatcher;
|
||||||
use App\Util\Broadcaster;
|
use App\Util\Broadcaster;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Mercure\HubInterface;
|
use Symfony\Component\Mercure\HubInterface;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
@@ -50,4 +52,15 @@ class ApiController extends AbstractController
|
|||||||
'message' => $response
|
'message' => $response
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/api/monitor/dispatch', name: 'api_monitor_dispatch', methods: ['GET'])]
|
||||||
|
public function dispatch(MonitorDispatcher $dispatcher): Response
|
||||||
|
{
|
||||||
|
$dispatcher();
|
||||||
|
|
||||||
|
return $this->json([
|
||||||
|
'status' => 200,
|
||||||
|
'message' => 'Manually dispatched MonitorDispatcher'
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,10 +47,12 @@ class MonitorDispatcher
|
|||||||
|
|
||||||
private function cleanupStuckMonitors(): void
|
private function cleanupStuckMonitors(): void
|
||||||
{
|
{
|
||||||
|
$hoursStuck = 4;
|
||||||
$monitors = $this->monitorRepository->findBy(['status' => 'In Progress']);
|
$monitors = $this->monitorRepository->findBy(['status' => 'In Progress']);
|
||||||
foreach ($monitors as $monitor) {
|
foreach ($monitors as $monitor) {
|
||||||
// Reset the status to active so it will be executed again
|
// Reset the status to active so it will be executed again
|
||||||
if ($monitor->getLastSearch()->diffInHours(Carbon::today()) > 6) {
|
if ($monitor->getLastSearch()->diffInHours(Carbon::today()) > $hoursStuck) {
|
||||||
|
$this->logger->info('[MonitorDispatcher] Cleaning up monitor: ' . $monitor->getId() . ' (' . $monitor->getTitle() . '), resetting status to \'Active\' from \''. $monitor->getStatus() .'\' after being stuck for ' . $hoursStuck . ' hours.');
|
||||||
$monitor->setStatus('Active');
|
$monitor->setStatus('Active');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ module.exports = {
|
|||||||
"transition-opacity",
|
"transition-opacity",
|
||||||
"ease-in",
|
"ease-in",
|
||||||
"duration-700",
|
"duration-700",
|
||||||
"opacity-100"
|
"opacity-100",
|
||||||
|
"table-row"
|
||||||
],
|
],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody class="flex-1 sm:flex-none">
|
<tbody class="flex-1 sm:flex-none">
|
||||||
{% for result in results.results %}
|
{% for result in results.results %}
|
||||||
<tr class="bg-white dark:bg-slate-700 flex flex-col flex-no wrap sm:table-row border-b border-gray-500" data-provider="{{ result.provider }}" data-languages="{{ result.languages|json_encode }}" {% if "tvshows" == results.media.mediaType %} data-season="{{ results.season }}"{% endif %}>
|
<tr class="bg-white dark:bg-slate-700 flex flex-col flex-no wrap r-tablerow border-b border-gray-500" data-provider="{{ result.provider }}" data-languages="{{ result.languages|json_encode }}" {% if "tvshows" == results.media.mediaType %} data-season="{{ results.season }}"{% endif %}>
|
||||||
<td id="size" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
|
<td id="size" class="px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-50">
|
||||||
{{ result.size }}
|
{{ result.size }}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user