fix: uses default image in episode results if image is missing, reduces cache life to next hour, clears cache during build
This commit is contained in:
@@ -47,6 +47,13 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// async clearCache() {
|
||||||
|
// await fetch(`/torrentio/tvshows/clear/${this.tmdbIdValue}/${this.imdbIdValue}/${this.seasonValue}/${this.episodeValue}`)
|
||||||
|
// .then(res => res.text())
|
||||||
|
// .then(response => {});
|
||||||
|
// }
|
||||||
|
|
||||||
async setActive() {
|
async setActive() {
|
||||||
this.activeValue = true;
|
this.activeValue = true;
|
||||||
this.element.classList.remove('hidden');
|
this.element.classList.remove('hidden');
|
||||||
|
|||||||
1
assets/icons/hugeicons/loading-01.svg
Normal file
1
assets/icons/hugeicons/loading-01.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="https://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" color="currentColor"><path d="M17.201 2H6.8c-1.458 0-2.737.985-2.795 2.404c-.074 1.785 1.182 2.97 2.5 4.083c1.825 1.54 2.737 2.31 2.832 3.284q.023.229 0 .458c-.095.975-1.007 1.744-2.832 3.284c-1.355 1.143-2.578 2.207-2.5 4.083C4.062 21.016 5.34 22 6.799 22H17.2c1.458 0 2.737-.985 2.796-2.404c.046-1.13-.373-2.254-1.262-3.036c-.405-.357-.826-.698-1.24-1.047c-1.824-1.54-2.736-2.31-2.831-3.284a2.3 2.3 0 0 1 0-.458c.095-.975 1.008-1.744 2.832-3.284c1.34-1.131 2.577-2.229 2.5-4.083C19.939 2.984 18.66 2 17.202 2"/><path d="M9 21.638c0-.442 0-.663.088-.856a1 1 0 0 1 .046-.09c.107-.183.288-.312.65-.571c1.006-.719 1.51-1.078 2.081-1.116q.135-.009.27 0c.572.038 1.075.397 2.08 1.116c.363.259.544.388.651.571q.026.045.046.09c.088.193.088.414.088.856V22H9z"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 928 B |
@@ -32,4 +32,12 @@
|
|||||||
<arg value="doctrine:migrations:migrate" />
|
<arg value="doctrine:migrations:migrate" />
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<target name="clearCache" description="Clear the application cache">
|
||||||
|
<exec executable="php">
|
||||||
|
<arg value="bin/console" />
|
||||||
|
<arg value="cache:pool:clear" />
|
||||||
|
<arg value="cache.app" />
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"doctrine/doctrine-migrations-bundle": "^3.4",
|
"doctrine/doctrine-migrations-bundle": "^3.4",
|
||||||
"doctrine/orm": "^3.3",
|
"doctrine/orm": "^3.3",
|
||||||
"dragonmantank/cron-expression": "^3.4",
|
"dragonmantank/cron-expression": "^3.4",
|
||||||
|
"nesbot/carbon": "^3.9",
|
||||||
"nihilarr/parse-torrent-name": "^0.0.1",
|
"nihilarr/parse-torrent-name": "^0.0.1",
|
||||||
"nyholm/psr7": "*",
|
"nyholm/psr7": "*",
|
||||||
"p3k/emoji-detector": "^1.2",
|
"p3k/emoji-detector": "^1.2",
|
||||||
|
|||||||
272
composer.lock
generated
272
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "1acedc6a795947368d0673ec79564bec",
|
"content-hash": "c9b0e6d834b028ec81a8ba1d24005d77",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "1tomany/rich-bundle",
|
"name": "1tomany/rich-bundle",
|
||||||
@@ -117,6 +117,75 @@
|
|||||||
},
|
},
|
||||||
"time": "2025-03-05T09:16:18+00:00"
|
"time": "2025-03-05T09:16:18+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "carbonphp/carbon-doctrine-types",
|
||||||
|
"version": "2.1.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/CarbonPHP/carbon-doctrine-types.git",
|
||||||
|
"reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/99f76ffa36cce3b70a4a6abce41dba15ca2e84cb",
|
||||||
|
"reference": "99f76ffa36cce3b70a4a6abce41dba15ca2e84cb",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.4 || ^8.0"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"doctrine/dbal": "<3.7.0 || >=4.0.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/dbal": "^3.7.0",
|
||||||
|
"nesbot/carbon": "^2.71.0 || ^3.0.0",
|
||||||
|
"phpunit/phpunit": "^10.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Carbon\\Doctrine\\": "src/Carbon/Doctrine/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "KyleKatarn",
|
||||||
|
"email": "kylekatarnls@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Types to use Carbon in Doctrine",
|
||||||
|
"keywords": [
|
||||||
|
"carbon",
|
||||||
|
"date",
|
||||||
|
"datetime",
|
||||||
|
"doctrine",
|
||||||
|
"time"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues",
|
||||||
|
"source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/2.1.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/kylekatarnls",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://opencollective.com/Carbon",
|
||||||
|
"type": "open_collective"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-12-11T17:09:12+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/semver",
|
"name": "composer/semver",
|
||||||
"version": "3.4.3",
|
"version": "3.4.3",
|
||||||
@@ -1554,6 +1623,112 @@
|
|||||||
],
|
],
|
||||||
"time": "2025-01-26T21:29:45+00:00"
|
"time": "2025-01-26T21:29:45+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nesbot/carbon",
|
||||||
|
"version": "3.9.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/CarbonPHP/carbon.git",
|
||||||
|
"reference": "ced71f79398ece168e24f7f7710462f462310d4d"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/ced71f79398ece168e24f7f7710462f462310d4d",
|
||||||
|
"reference": "ced71f79398ece168e24f7f7710462f462310d4d",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"carbonphp/carbon-doctrine-types": "<100.0",
|
||||||
|
"ext-json": "*",
|
||||||
|
"php": "^8.1",
|
||||||
|
"psr/clock": "^1.0",
|
||||||
|
"symfony/clock": "^6.3 || ^7.0",
|
||||||
|
"symfony/polyfill-mbstring": "^1.0",
|
||||||
|
"symfony/translation": "^4.4.18 || ^5.2.1|| ^6.0 || ^7.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/clock-implementation": "1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/dbal": "^3.6.3 || ^4.0",
|
||||||
|
"doctrine/orm": "^2.15.2 || ^3.0",
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.57.2",
|
||||||
|
"kylekatarnls/multi-tester": "^2.5.3",
|
||||||
|
"ondrejmirtes/better-reflection": "^6.25.0.4",
|
||||||
|
"phpmd/phpmd": "^2.15.0",
|
||||||
|
"phpstan/extension-installer": "^1.3.1",
|
||||||
|
"phpstan/phpstan": "^1.11.2",
|
||||||
|
"phpunit/phpunit": "^10.5.20",
|
||||||
|
"squizlabs/php_codesniffer": "^3.9.0"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/carbon"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Carbon\\Laravel\\ServiceProvider"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"phpstan": {
|
||||||
|
"includes": [
|
||||||
|
"extension.neon"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-2.x": "2.x-dev",
|
||||||
|
"dev-master": "3.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Carbon\\": "src/Carbon/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Brian Nesbitt",
|
||||||
|
"email": "brian@nesbot.com",
|
||||||
|
"homepage": "https://markido.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "kylekatarnls",
|
||||||
|
"homepage": "https://github.com/kylekatarnls"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "An API extension for DateTime that supports 281 different languages.",
|
||||||
|
"homepage": "https://carbon.nesbot.com",
|
||||||
|
"keywords": [
|
||||||
|
"date",
|
||||||
|
"datetime",
|
||||||
|
"time"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"docs": "https://carbon.nesbot.com/docs",
|
||||||
|
"issues": "https://github.com/CarbonPHP/carbon/issues",
|
||||||
|
"source": "https://github.com/CarbonPHP/carbon"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/sponsors/kylekatarnls",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://opencollective.com/Carbon#sponsor",
|
||||||
|
"type": "opencollective"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-05-01T19:51:51+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "nihilarr/parse-torrent-name",
|
"name": "nihilarr/parse-torrent-name",
|
||||||
"version": "v0.0.1",
|
"version": "v0.0.1",
|
||||||
@@ -7039,6 +7214,101 @@
|
|||||||
],
|
],
|
||||||
"time": "2025-04-20T20:18:16+00:00"
|
"time": "2025-04-20T20:18:16+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/translation",
|
||||||
|
"version": "v7.2.6",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/translation.git",
|
||||||
|
"reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/translation/zipball/e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6",
|
||||||
|
"reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.2",
|
||||||
|
"symfony/deprecation-contracts": "^2.5|^3",
|
||||||
|
"symfony/polyfill-mbstring": "~1.0",
|
||||||
|
"symfony/translation-contracts": "^2.5|^3.0"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/config": "<6.4",
|
||||||
|
"symfony/console": "<6.4",
|
||||||
|
"symfony/dependency-injection": "<6.4",
|
||||||
|
"symfony/http-client-contracts": "<2.5",
|
||||||
|
"symfony/http-kernel": "<6.4",
|
||||||
|
"symfony/service-contracts": "<2.5",
|
||||||
|
"symfony/twig-bundle": "<6.4",
|
||||||
|
"symfony/yaml": "<6.4"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"symfony/translation-implementation": "2.3|3.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"nikic/php-parser": "^4.18|^5.0",
|
||||||
|
"psr/log": "^1|^2|^3",
|
||||||
|
"symfony/config": "^6.4|^7.0",
|
||||||
|
"symfony/console": "^6.4|^7.0",
|
||||||
|
"symfony/dependency-injection": "^6.4|^7.0",
|
||||||
|
"symfony/finder": "^6.4|^7.0",
|
||||||
|
"symfony/http-client-contracts": "^2.5|^3.0",
|
||||||
|
"symfony/http-kernel": "^6.4|^7.0",
|
||||||
|
"symfony/intl": "^6.4|^7.0",
|
||||||
|
"symfony/polyfill-intl-icu": "^1.21",
|
||||||
|
"symfony/routing": "^6.4|^7.0",
|
||||||
|
"symfony/service-contracts": "^2.5|^3",
|
||||||
|
"symfony/yaml": "^6.4|^7.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"Resources/functions.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Translation\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides tools to internationalize your application",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/translation/tree/v7.2.6"
|
||||||
|
},
|
||||||
|
"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": "2025-04-07T19:09:28+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/translation-contracts",
|
"name": "symfony/translation-contracts",
|
||||||
"version": "v3.5.1",
|
"version": "v3.5.1",
|
||||||
|
|||||||
7
config/packages/translation.yaml
Normal file
7
config/packages/translation.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
framework:
|
||||||
|
default_locale: en
|
||||||
|
translator:
|
||||||
|
default_path: '%kernel.project_dir%/translations'
|
||||||
|
fallbacks:
|
||||||
|
- en
|
||||||
|
providers:
|
||||||
@@ -6,6 +6,7 @@ use App\Search\Action\Handler\GetMediaInfoHandler;
|
|||||||
use App\Search\Action\Handler\SearchHandler;
|
use App\Search\Action\Handler\SearchHandler;
|
||||||
use App\Search\Action\Input\GetMediaInfoInput;
|
use App\Search\Action\Input\GetMediaInfoInput;
|
||||||
use App\Search\Action\Input\SearchInput;
|
use App\Search\Action\Input\SearchInput;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
@@ -37,8 +38,8 @@ final class SearchController extends AbstractController
|
|||||||
): Response {
|
): Response {
|
||||||
$cacheId = sprintf("page.%s.%s", $input->mediaType, $input->tmdbId);
|
$cacheId = sprintf("page.%s.%s", $input->mediaType, $input->tmdbId);
|
||||||
|
|
||||||
// return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
||||||
// $item->expiresAt(new \DateTimeImmutable("today 11:59 pm"));
|
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
||||||
$result = $this->getMediaInfoHandler->handle($input->toCommand());
|
$result = $this->getMediaInfoHandler->handle($input->toCommand());
|
||||||
return $this->render('search/result.html.twig', [
|
return $this->render('search/result.html.twig', [
|
||||||
'results' => $result,
|
'results' => $result,
|
||||||
@@ -51,6 +52,6 @@ final class SearchController extends AbstractController
|
|||||||
'episode' => ''
|
'episode' => ''
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ use App\Torrentio\Action\Handler\GetMovieOptionsHandler;
|
|||||||
use App\Torrentio\Action\Handler\GetTvShowOptionsHandler;
|
use App\Torrentio\Action\Handler\GetTvShowOptionsHandler;
|
||||||
use App\Torrentio\Action\Input\GetMovieOptionsInput;
|
use App\Torrentio\Action\Input\GetMovieOptionsInput;
|
||||||
use App\Torrentio\Action\Input\GetTvShowOptionsInput;
|
use App\Torrentio\Action\Input\GetTvShowOptionsInput;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Mercure\HubInterface;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Contracts\Cache\CacheInterface;
|
use Symfony\Contracts\Cache\CacheInterface;
|
||||||
use Symfony\Contracts\Cache\ItemInterface;
|
use Symfony\Contracts\Cache\ItemInterface;
|
||||||
@@ -17,6 +19,8 @@ final class TorrentioController extends AbstractController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly GetMovieOptionsHandler $getMovieOptionsHandler,
|
private readonly GetMovieOptionsHandler $getMovieOptionsHandler,
|
||||||
private readonly GetTvShowOptionsHandler $getTvShowOptionsHandler,
|
private readonly GetTvShowOptionsHandler $getTvShowOptionsHandler,
|
||||||
|
private readonly HubInterface $hub,
|
||||||
|
private readonly \Twig\Environment $renderer,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[Route('/torrentio/movies/{tmdbId}/{imdbId}', name: 'app_torrentio_movies')]
|
#[Route('/torrentio/movies/{tmdbId}/{imdbId}', name: 'app_torrentio_movies')]
|
||||||
@@ -29,7 +33,7 @@ final class TorrentioController extends AbstractController
|
|||||||
);
|
);
|
||||||
|
|
||||||
return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
||||||
$item->expiresAt(new \DateTimeImmutable("today 11:59 pm"));
|
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
||||||
$results = $this->getMovieOptionsHandler->handle($input->toCommand());
|
$results = $this->getMovieOptionsHandler->handle($input->toCommand());
|
||||||
return $this->render('torrentio/movies.html.twig', [
|
return $this->render('torrentio/movies.html.twig', [
|
||||||
'results' => $results,
|
'results' => $results,
|
||||||
@@ -48,12 +52,45 @@ 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(new \DateTimeImmutable("today 11:59 pm"));
|
$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')]
|
||||||
|
public function clearTvShowOptions(GetTvShowOptionsInput $input, CacheInterface $cache): Response
|
||||||
|
{
|
||||||
|
$cacheId = sprintf(
|
||||||
|
"page.torrentio.tvshows.%s.%s.%s.%s",
|
||||||
|
$input->tmdbId,
|
||||||
|
$input->imdbId,
|
||||||
|
$input->season,
|
||||||
|
$input->episode,
|
||||||
|
);
|
||||||
|
$cache->delete($cacheId);
|
||||||
|
|
||||||
|
$cacheId = sprintf("page.%s.%s", "tvshows", $input->tmdbId);
|
||||||
|
$cache->delete($cacheId);
|
||||||
|
|
||||||
|
$this->hub->publish(new \Symfony\Component\Mercure\Update(
|
||||||
|
'alerts',
|
||||||
|
$this->renderer->render('broadcast/Alert.html.twig', [
|
||||||
|
'alert_id' => uniqid(),
|
||||||
|
'title' => 'Success',
|
||||||
|
'message' => 'Torrentio cache Cleared.',
|
||||||
|
])
|
||||||
|
));
|
||||||
|
|
||||||
|
return $cache->get($cacheId, function (ItemInterface $item) use ($input) {
|
||||||
|
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
||||||
|
$results = $this->getTvShowOptionsHandler->handle($input->toCommand());
|
||||||
|
return $this->render('torrentio/tvshows.html.twig', [
|
||||||
|
'results' => $results,
|
||||||
|
]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ class Tmdb
|
|||||||
imdbId: $data['external_ids']['imdb_id'],
|
imdbId: $data['external_ids']['imdb_id'],
|
||||||
tmdbId: $data['id'],
|
tmdbId: $data['id'],
|
||||||
title: $data['name'],
|
title: $data['name'],
|
||||||
poster: $posterBasePath . $data['poster_path'],
|
poster: (null !== $data['poster_path']) ? $posterBasePath . $data['poster_path'] : null,
|
||||||
description: $data['overview'],
|
description: $data['overview'],
|
||||||
year: (new \DateTime($data['first_air_date']))->format('Y'),
|
year: (new \DateTime($data['first_air_date']))->format('Y'),
|
||||||
mediaType: "tvshows",
|
mediaType: "tvshows",
|
||||||
@@ -236,7 +236,7 @@ class Tmdb
|
|||||||
imdbId: $data['external_ids']['imdb_id'],
|
imdbId: $data['external_ids']['imdb_id'],
|
||||||
tmdbId: $data['id'],
|
tmdbId: $data['id'],
|
||||||
title: $data['name'],
|
title: $data['name'],
|
||||||
poster: $posterBasePath . $data['still_path'],
|
poster: (null !== $data['still_path']) ? $posterBasePath . $data['still_path'] : null,
|
||||||
description: $data['overview'],
|
description: $data['overview'],
|
||||||
year: (new \DateTime($data['air_date']))->format('Y'),
|
year: (new \DateTime($data['air_date']))->format('Y'),
|
||||||
mediaType: "tvshows",
|
mediaType: "tvshows",
|
||||||
@@ -251,7 +251,7 @@ class Tmdb
|
|||||||
imdbId: $data['external_ids']['imdb_id'],
|
imdbId: $data['external_ids']['imdb_id'],
|
||||||
tmdbId: $data['id'],
|
tmdbId: $data['id'],
|
||||||
title: $data['title'],
|
title: $data['title'],
|
||||||
poster: $posterBasePath . $data['poster_path'],
|
poster: (null !== $data['poster_path']) ? $posterBasePath . $data['poster_path'] : null,
|
||||||
description: $data['overview'],
|
description: $data['overview'],
|
||||||
year: (new \DateTime($data['release_date']))->format('Y'),
|
year: (new \DateTime($data['release_date']))->format('Y'),
|
||||||
mediaType: "movies",
|
mediaType: "movies",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Torrentio\Client\Rule\DownloadOptionFilter\Resolution;
|
|||||||
use App\Torrentio\Client\Rule\RuleEngine;
|
use App\Torrentio\Client\Rule\RuleEngine;
|
||||||
use App\Torrentio\MediaResult;
|
use App\Torrentio\MediaResult;
|
||||||
use App\Torrentio\Result\ResultFactory;
|
use App\Torrentio\Result\ResultFactory;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||||
use Symfony\Contracts\Cache\CacheInterface;
|
use Symfony\Contracts\Cache\CacheInterface;
|
||||||
use Symfony\Contracts\Cache\ItemInterface;
|
use Symfony\Contracts\Cache\ItemInterface;
|
||||||
@@ -32,7 +33,7 @@ class Torrentio
|
|||||||
$cacheKey = "torrentio.{$imdbCode}";
|
$cacheKey = "torrentio.{$imdbCode}";
|
||||||
|
|
||||||
$results = $this->cache->get($cacheKey, function (ItemInterface $item) use ($imdbCode) {
|
$results = $this->cache->get($cacheKey, function (ItemInterface $item) use ($imdbCode) {
|
||||||
$item->expiresAt(new \DateTimeImmutable("today 11:59 pm"));
|
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
||||||
$response = file_get_contents(str_replace('{imdbCode}', $imdbCode, $this->searchUrl));
|
$response = file_get_contents(str_replace('{imdbCode}', $imdbCode, $this->searchUrl));
|
||||||
return json_decode(
|
return json_decode(
|
||||||
$response,
|
$response,
|
||||||
@@ -67,7 +68,7 @@ class Torrentio
|
|||||||
{
|
{
|
||||||
$cacheKey = "torrentio.$imdbId.$season.$episode";
|
$cacheKey = "torrentio.$imdbId.$season.$episode";
|
||||||
$results = $this->cache->get($cacheKey, function (ItemInterface $item) use ($imdbId, $season, $episode) {
|
$results = $this->cache->get($cacheKey, function (ItemInterface $item) use ($imdbId, $season, $episode) {
|
||||||
$item->expiresAt(new \DateTimeImmutable("today 11:59 pm"));
|
$item->expiresAt(Carbon::now()->addHour()->setMinute(0)->setSecond(0));
|
||||||
$response = file_get_contents(str_replace('{imdbCode}', "$imdbId:$season:$episode", $this->searchUrl));
|
$response = file_get_contents(str_replace('{imdbCode}', "$imdbId:$season:$episode", $this->searchUrl));
|
||||||
return json_decode(
|
return json_decode(
|
||||||
$response,
|
$response,
|
||||||
|
|||||||
13
symfony.lock
13
symfony.lock
@@ -210,6 +210,19 @@
|
|||||||
"assets/controllers/hello_controller.js"
|
"assets/controllers/hello_controller.js"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"symfony/translation": {
|
||||||
|
"version": "7.2",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "6.3",
|
||||||
|
"ref": "e28e27f53663cc34f0be2837aba18e3a1bef8e7b"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/translation.yaml",
|
||||||
|
"translations/.gitignore"
|
||||||
|
]
|
||||||
|
},
|
||||||
"symfony/twig-bundle": {
|
"symfony/twig-bundle": {
|
||||||
"version": "7.2",
|
"version": "7.2",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
<div{{ attributes }}>
|
<div{{ attributes }}>
|
||||||
<div class="p-4 flex flex-row gap-6 bg-orange-500 bg-clip-padding backdrop-filter backdrop-blur-md bg-opacity-60 rounded-md">
|
<div class="p-4 flex flex-row gap-6 bg-orange-500 bg-clip-padding backdrop-filter backdrop-blur-md bg-opacity-60 rounded-md">
|
||||||
<img class="w-24" src="{{ poster }}" />
|
{% if poster != null and poster != "https://image.tmdb.org/t/p/w500" %}
|
||||||
|
<img class="w-24 rounded-lg" src="{{ poster }}" />
|
||||||
|
{% else %}
|
||||||
|
<div class="w-32 h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
||||||
|
<twig:ux:icon width="16" name="hugeicons:loading-01" />
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="w-full flex flex-col">
|
<div class="w-full flex flex-col">
|
||||||
<h3 class="mb-4 text-xl font-medium leading-tight font-bold text-gray-50">
|
<h3 class="mb-4 text-xl font-medium leading-tight font-bold text-gray-50">
|
||||||
{{ title }} - {{ year }}
|
{{ title }} - {{ year }}
|
||||||
|
|||||||
@@ -8,7 +8,14 @@
|
|||||||
<div class="flex flex-row w-full gap-2">
|
<div class="flex flex-row w-full gap-2">
|
||||||
<twig:Card title="" contentClass="flex flex-col gap-4 justify-between w-full text-gray-50">
|
<twig:Card title="" contentClass="flex flex-col gap-4 justify-between w-full text-gray-50">
|
||||||
<div class="p-4 flex flex-row gap-6">
|
<div class="p-4 flex flex-row gap-6">
|
||||||
<img class="w-40" src="{{ results.media.poster }}" />
|
{% if results.media.poster != null %}
|
||||||
|
<img class="w-40 rounded-lg" src="{{ results.media.poster }}" />
|
||||||
|
{% else %}
|
||||||
|
<div class="w-40 h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
||||||
|
<twig:ux:icon width="24" name="hugeicons:loading-01" />
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="w-full flex flex-col">
|
<div class="w-full flex flex-col">
|
||||||
<div class="mb-4 flex flex-row gap-2 justify-between">
|
<div class="mb-4 flex flex-row gap-2 justify-between">
|
||||||
<h3 class="text-xl font-medium leading-tight font-bold text-gray-50">
|
<h3 class="text-xl font-medium leading-tight font-bold text-gray-50">
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<div class="p-6 flex flex-col gap-6 bg-orange-500 bg-clip-padding backdrop-filter backdrop-blur-md bg-opacity-60 rounded-md">
|
<div class="p-6 flex flex-col gap-6 bg-orange-500 bg-clip-padding backdrop-filter backdrop-blur-md bg-opacity-60 rounded-md">
|
||||||
<div class="flex flex-row gap-4">
|
<div class="flex flex-row gap-4">
|
||||||
<img class="w-64 rounded-lg" src="{{ results.media.poster }}" />
|
{% if results.media.poster != null %}
|
||||||
|
<img class="w-64 rounded-lg" src="{{ results.media.poster }}" />
|
||||||
|
{% else %}
|
||||||
|
<div class="w-64 h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
||||||
|
<twig:ux:icon width="32" name="hugeicons:loading-01" />
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="flex flex-col gap-4 grow">
|
<div class="flex flex-col gap-4 grow">
|
||||||
<h4 class="text-md font-bold">{{ results.episode }}. {{ results.media.title }}</h4>
|
<h4 class="text-md font-bold">{{ results.episode }}. {{ results.media.title }}</h4>
|
||||||
<p>{{ results.media.description }}</p>
|
<p>{{ results.media.description }}</p>
|
||||||
@@ -10,6 +16,9 @@
|
|||||||
><span {{ stimulus_target('tv-results', 'count') }}>{{ results.results|length }}</span> results</small>
|
><span {{ stimulus_target('tv-results', 'count') }}>{{ results.results|length }}</span> results</small>
|
||||||
<small class="py-1 px-1.5 grow-0 font-bold bg-gray-700 rounded-lg font-normal text-white" title="Air date {{ results.media.episodeAirDate }}"
|
<small class="py-1 px-1.5 grow-0 font-bold bg-gray-700 rounded-lg font-normal text-white" title="Air date {{ results.media.episodeAirDate }}"
|
||||||
>{{ results.media.episodeAirDate }}</small>
|
>{{ results.media.episodeAirDate }}</small>
|
||||||
|
{# <small class="py-1 px-1.5 grow-0 font-bold bg-red-600 hover:bg-red-700 rounded-lg font-normal text-white cursor-pointer" title="Clear cache for {{ results.media.title }}"#}
|
||||||
|
{# {{ stimulus_action('tv-results', 'clearCache', 'click') }}#}
|
||||||
|
{# >Clear Cache</small>#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-4 justify-between">
|
<div class="flex flex-col gap-4 justify-between">
|
||||||
|
|||||||
0
translations/.gitignore
vendored
Normal file
0
translations/.gitignore
vendored
Normal file
Reference in New Issue
Block a user