feat: allows configuring whether to cache torrentio results
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 13s
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 13s
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Base;
|
||||
|
||||
use App\Base\Dto\AppVersionDto;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
|
||||
final class ConfigResolver
|
||||
@@ -14,6 +15,7 @@ final class ConfigResolver
|
||||
|
||||
public function __construct(
|
||||
private readonly DenormalizerInterface $denormalizer,
|
||||
private readonly RequestStack $requestStack,
|
||||
|
||||
#[Autowire(param: 'app.url')]
|
||||
private readonly ?string $appUrl = null,
|
||||
@@ -62,6 +64,9 @@ final class ConfigResolver
|
||||
|
||||
#[Autowire(param: 'sentry.javascript_url')]
|
||||
private ?string $sentryJavascriptUrl = null,
|
||||
|
||||
#[Autowire(param: 'torrentio.cache_results')]
|
||||
private ?bool $torrentioCacheResults = null,
|
||||
) {}
|
||||
|
||||
public function validate(): bool
|
||||
@@ -110,6 +115,11 @@ final class ConfigResolver
|
||||
return $this->authOidcBypassFormLogin;
|
||||
}
|
||||
|
||||
public function isTorrentioCacheEnabled(): bool
|
||||
{
|
||||
return $this->torrentioCacheResults;
|
||||
}
|
||||
|
||||
public function getAppVersion(): AppVersionDto
|
||||
{
|
||||
$matches = [];
|
||||
|
||||
Reference in New Issue
Block a user