Compare commits
5 Commits
dev-downlo
...
dev-redis
| Author | SHA1 | Date | |
|---|---|---|---|
| 687b5ed873 | |||
| e5f0f358b7 | |||
| fd84648100 | |||
| f3285ba60c | |||
| 4f6f8f43f1 |
@@ -8,3 +8,4 @@ MERCURE_PUBLIC_URL=%%mercure_public_url%%
|
|||||||
MERCURE_JWT_SECRET="%%mercure_jwt_secret%%"
|
MERCURE_JWT_SECRET="%%mercure_jwt_secret%%"
|
||||||
JELLYFIN_URL=%%jellyfin_url%%
|
JELLYFIN_URL=%%jellyfin_url%%
|
||||||
JELLYFIN_TOKEN=%%jellyfin_token%%
|
JELLYFIN_TOKEN=%%jellyfin_token%%
|
||||||
|
REDIS_HOST="%%redis_host%%"
|
||||||
|
|||||||
@@ -18,13 +18,15 @@ export default class extends Controller {
|
|||||||
static targets = ['list']
|
static targets = ['list']
|
||||||
|
|
||||||
options = []
|
options = []
|
||||||
|
optionsLoaded = false
|
||||||
|
|
||||||
async connect() {
|
async connect() {
|
||||||
await this.setOptions();
|
await this.setOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
async setOptions() {
|
async setOptions() {
|
||||||
if (this.options.length === 0) {
|
if (false === this.optionsLoaded) {
|
||||||
|
this.optionsLoaded = true;
|
||||||
await fetch(`/torrentio/movies/${this.tmdbIdValue}/${this.imdbIdValue}`)
|
await fetch(`/torrentio/movies/${this.tmdbIdValue}/${this.imdbIdValue}`)
|
||||||
.then(res => res.text())
|
.then(res => res.text())
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<token key="mercure_jwt_secret" value="${MERCURE_JWT_SECRET}" />
|
<token key="mercure_jwt_secret" value="${MERCURE_JWT_SECRET}" />
|
||||||
<token key="jellyfin_url" value="${JELLYFIN_URL}" />
|
<token key="jellyfin_url" value="${JELLYFIN_URL}" />
|
||||||
<token key="jellyfin_token" value="${JELLYFIN_TOKEN}" />
|
<token key="jellyfin_token" value="${JELLYFIN_TOKEN}" />
|
||||||
|
<token key="redis_host" value="${REDIS_HOST}" />
|
||||||
</replacetokens>
|
</replacetokens>
|
||||||
</filterchain>
|
</filterchain>
|
||||||
</copy>
|
</copy>
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ services:
|
|||||||
- $PWD/bash/caddy:/etc/caddy
|
- $PWD/bash/caddy:/etc/caddy
|
||||||
- $PWD/bash/certs:/etc/ssl
|
- $PWD/bash/certs:/etc/ssl
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:latest
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
command: redis-server --maxmemory 512MB
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
php:
|
php:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
@@ -63,3 +70,4 @@ volumes:
|
|||||||
mysql:
|
mysql:
|
||||||
mercure_data:
|
mercure_data:
|
||||||
mercure_config:
|
mercure_config:
|
||||||
|
redis_data:
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"nyholm/psr7": "*",
|
"nyholm/psr7": "*",
|
||||||
"p3k/emoji-detector": "^1.2",
|
"p3k/emoji-detector": "^1.2",
|
||||||
"php-tmdb/api": "^4.1",
|
"php-tmdb/api": "^4.1",
|
||||||
|
"predis/predis": "^2.4",
|
||||||
"symfony/asset": "7.2.*",
|
"symfony/asset": "7.2.*",
|
||||||
"symfony/console": "7.2.*",
|
"symfony/console": "7.2.*",
|
||||||
"symfony/doctrine-messenger": "7.2.*",
|
"symfony/doctrine-messenger": "7.2.*",
|
||||||
|
|||||||
64
composer.lock
generated
64
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": "e0322cfec0023bee458190f38b4cab8c",
|
"content-hash": "94d3dbf218bac7512ce9ced86ff066aa",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "1tomany/data-uri",
|
"name": "1tomany/data-uri",
|
||||||
@@ -2314,6 +2314,68 @@
|
|||||||
},
|
},
|
||||||
"time": "2025-02-19T13:28:12+00:00"
|
"time": "2025-02-19T13:28:12+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "predis/predis",
|
||||||
|
"version": "v2.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/predis/predis.git",
|
||||||
|
"reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/predis/predis/zipball/f49e13ee3a2a825631562aa0223ac922ec5d058b",
|
||||||
|
"reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.3",
|
||||||
|
"phpstan/phpstan": "^1.9",
|
||||||
|
"phpunit/phpcov": "^6.0 || ^8.0",
|
||||||
|
"phpunit/phpunit": "^8.0 || ^9.4"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-relay": "Faster connection with in-memory caching (>=0.6.2)"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Predis\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Till Krüss",
|
||||||
|
"homepage": "https://till.im",
|
||||||
|
"role": "Maintainer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A flexible and feature-complete Redis/Valkey client for PHP.",
|
||||||
|
"homepage": "http://github.com/predis/predis",
|
||||||
|
"keywords": [
|
||||||
|
"nosql",
|
||||||
|
"predis",
|
||||||
|
"redis"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/predis/predis/issues",
|
||||||
|
"source": "https://github.com/predis/predis/tree/v2.4.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/sponsors/tillkruss",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-04-30T15:16:02+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/cache",
|
"name": "psr/cache",
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ framework:
|
|||||||
# Other options include:
|
# Other options include:
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
#app: cache.adapter.redis
|
app: cache.adapter.redis
|
||||||
#default_redis_provider: redis://localhost
|
default_redis_provider: '%env(REDIS_HOST)%'
|
||||||
|
|
||||||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
||||||
#app: cache.adapter.apcu
|
#app: cache.adapter.apcu
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class DownloadRepository extends ServiceEntityRepository
|
|||||||
$firstResult = ($pageNumber - 1) * $perPage;
|
$firstResult = ($pageNumber - 1) * $perPage;
|
||||||
$query = $this->createQueryBuilder('d')
|
$query = $this->createQueryBuilder('d')
|
||||||
->andWhere('d.status IN (:statuses)')
|
->andWhere('d.status IN (:statuses)')
|
||||||
->orderBy('d.id', 'DESC')
|
->orderBy('d.id', 'ASC')
|
||||||
->setParameter('statuses', ['New', 'In Progress'])
|
->setParameter('statuses', ['New', 'In Progress'])
|
||||||
->setFirstResult($firstResult)
|
->setFirstResult($firstResult)
|
||||||
->setMaxResults($perPage)
|
->setMaxResults($perPage)
|
||||||
@@ -66,6 +66,7 @@ class DownloadRepository extends ServiceEntityRepository
|
|||||||
->setImdbId($imdbId)
|
->setImdbId($imdbId)
|
||||||
->setMediaType($mediaType)
|
->setMediaType($mediaType)
|
||||||
->setBatchId($batchId)
|
->setBatchId($batchId)
|
||||||
|
->setProgress(0)
|
||||||
->setStatus($status);
|
->setStatus($status);
|
||||||
|
|
||||||
$this->getEntityManager()->persist($download);
|
$this->getEntityManager()->persist($download);
|
||||||
|
|||||||
Reference in New Issue
Block a user