Compare commits
1 Commits
6fbd56c952
...
prod-horiz
| Author | SHA1 | Date | |
|---|---|---|---|
| d49bd6b756 |
2
AllFundsTransferToDansAccount/extension.py
Normal file
2
AllFundsTransferToDansAccount/extension.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# This extension transfers half a cent off each transaction into Dan's personal account
|
||||||
|
# Dan is a good boi and has a family to feed
|
||||||
@@ -6,14 +6,6 @@ controllersBase:
|
|||||||
defaults:
|
defaults:
|
||||||
schemes: [ 'https' ]
|
schemes: [ 'https' ]
|
||||||
|
|
||||||
controllersEventLog:
|
|
||||||
resource:
|
|
||||||
path: ../src/EventLog/Framework/Controller/
|
|
||||||
namespace: App\EventLog\Framework\Controller
|
|
||||||
type: attribute
|
|
||||||
defaults:
|
|
||||||
schemes: [ 'https' ]
|
|
||||||
|
|
||||||
controllersLibrary:
|
controllersLibrary:
|
||||||
resource:
|
resource:
|
||||||
path: ../src/Library/Framework/Controller/
|
path: ../src/Library/Framework/Controller/
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ services:
|
|||||||
replicas: 2
|
replicas: 2
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
|
logging:
|
||||||
|
driver: "gelf"
|
||||||
|
options:
|
||||||
|
gelf-address: "tcp://192.168.1.197:12203"
|
||||||
|
|
||||||
|
|
||||||
scheduler:
|
scheduler:
|
||||||
@@ -39,6 +43,11 @@ services:
|
|||||||
command: -vv
|
command: -vv
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
|
logging:
|
||||||
|
driver: "gelf"
|
||||||
|
options:
|
||||||
|
gelf-address: "tcp://192.168.1.197:12204"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20251101194723 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql(<<<'SQL'
|
|
||||||
ALTER TABLE user_preference CHANGE preference_value preference_value VARCHAR(255) DEFAULT NULL
|
|
||||||
SQL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql(<<<'SQL'
|
|
||||||
ALTER TABLE user_preference CHANGE preference_value preference_value VARCHAR(1024) DEFAULT NULL
|
|
||||||
SQL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
psalm.xml
17
psalm.xml
@@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<psalm
|
|
||||||
errorLevel="7"
|
|
||||||
resolveFromConfigFile="true"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns="https://getpsalm.org/schema/config"
|
|
||||||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
|
|
||||||
findUnusedBaselineEntry="true"
|
|
||||||
findUnusedCode="true"
|
|
||||||
>
|
|
||||||
<projectFiles>
|
|
||||||
<directory name="src" />
|
|
||||||
<ignoreFiles>
|
|
||||||
<directory name="vendor" />
|
|
||||||
</ignoreFiles>
|
|
||||||
</projectFiles>
|
|
||||||
</psalm>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Action\Command;
|
|
||||||
|
|
||||||
use OneToMany\RichBundle\Contract\CommandInterface;
|
|
||||||
|
|
||||||
/** @implements CommandInterface<AddEventLogCommand> */
|
|
||||||
class AddEventLogCommand implements CommandInterface
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public string $type,
|
|
||||||
public string $message,
|
|
||||||
public array $context,
|
|
||||||
) {}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Action\Handler;
|
|
||||||
|
|
||||||
use App\EventLog\Framework\Repository\EventLogRepository;
|
|
||||||
use App\EventLog\Action\Command\AddEventLogCommand;
|
|
||||||
use App\EventLog\Action\Result\AddEventLogResult;
|
|
||||||
use OneToMany\RichBundle\Contract\CommandInterface;
|
|
||||||
use OneToMany\RichBundle\Contract\HandlerInterface;
|
|
||||||
use OneToMany\RichBundle\Contract\ResultInterface;
|
|
||||||
|
|
||||||
/*** @implements HandlerInterface<AddEventLogCommand> */
|
|
||||||
class AddEventLogHandler implements HandlerInterface
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
private EventLogRepository $repository,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
public function handle(CommandInterface $command): ResultInterface
|
|
||||||
{
|
|
||||||
$eventLog = $this->repository->insert(
|
|
||||||
type: $command->type,
|
|
||||||
message: $command->message,
|
|
||||||
context: $command->context
|
|
||||||
);
|
|
||||||
return new AddEventLogResult($eventLog);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Action\Input;
|
|
||||||
|
|
||||||
use App\EventLog\Action\Command\AddEventLogCommand;
|
|
||||||
use OneToMany\RichBundle\Attribute\SourceQuery;
|
|
||||||
use OneToMany\RichBundle\Attribute\SourceRequest;
|
|
||||||
use OneToMany\RichBundle\Contract\CommandInterface;
|
|
||||||
use OneToMany\RichBundle\Contract\InputInterface;
|
|
||||||
|
|
||||||
/** @implements InputInterface<AddEventLogCommand> */
|
|
||||||
class AddEventLogInput implements InputInterface
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
#[SourceQuery('type')]
|
|
||||||
#[SourceRequest('type')]
|
|
||||||
public string $type,
|
|
||||||
|
|
||||||
#[SourceQuery('message')]
|
|
||||||
#[SourceRequest('message')]
|
|
||||||
public string $message,
|
|
||||||
|
|
||||||
#[SourceQuery('context')]
|
|
||||||
#[SourceRequest('context')]
|
|
||||||
public array $context = []
|
|
||||||
){}
|
|
||||||
|
|
||||||
public function toCommand(): CommandInterface
|
|
||||||
{
|
|
||||||
return new AddEventLogCommand(
|
|
||||||
$this->type,
|
|
||||||
$this->message,
|
|
||||||
$this->context
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Action\Result;
|
|
||||||
|
|
||||||
use App\EventLog\Framework\Entity\EventLog;
|
|
||||||
use OneToMany\RichBundle\Contract\ResultInterface;
|
|
||||||
|
|
||||||
/** @implements ResultInterface<AddEventLogResult> */
|
|
||||||
class AddEventLogResult implements ResultInterface
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
public EventLog $eventLog,
|
|
||||||
) {}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Framework\Controller;
|
|
||||||
|
|
||||||
use App\Base\Service\Broadcaster;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
|
||||||
|
|
||||||
final class EventLogController extends AbstractController
|
|
||||||
{
|
|
||||||
public function __construct(
|
|
||||||
private readonly Broadcaster $broadcaster,
|
|
||||||
) {}
|
|
||||||
|
|
||||||
#[Route('/alert', name: 'app_alert')]
|
|
||||||
public function index(): Response
|
|
||||||
{
|
|
||||||
$this->broadcaster->alert(
|
|
||||||
'Added to queue',
|
|
||||||
'This is a testy test!'
|
|
||||||
);
|
|
||||||
|
|
||||||
return $this->json([
|
|
||||||
'Success' => 'Published'
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Framework\Entity;
|
|
||||||
|
|
||||||
use App\EventLog\Framework\Repository\EventLogRepository;
|
|
||||||
use Doctrine\DBAL\Types\Types;
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: EventLogRepository::class)]
|
|
||||||
class EventLog
|
|
||||||
{
|
|
||||||
#[ORM\Id]
|
|
||||||
#[ORM\GeneratedValue]
|
|
||||||
#[ORM\Column(nullable: true)]
|
|
||||||
private ?int $id = null;
|
|
||||||
|
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
|
||||||
private ?string $type = null;
|
|
||||||
|
|
||||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
|
||||||
private ?string $message = null;
|
|
||||||
|
|
||||||
#[ORM\Column(type: Types::JSON, nullable: true)]
|
|
||||||
private ?array $context = null;
|
|
||||||
|
|
||||||
public function getId(): ?int
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getType(): ?string
|
|
||||||
{
|
|
||||||
return $this->type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setType(?string $type): self
|
|
||||||
{
|
|
||||||
$this->type = $type;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMessage(): ?string
|
|
||||||
{
|
|
||||||
return $this->message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setMessage(?string $message): self
|
|
||||||
{
|
|
||||||
$this->message = $message;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getContext(): ?array
|
|
||||||
{
|
|
||||||
return $this->context;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setContext(?array $context): self
|
|
||||||
{
|
|
||||||
$this->context = $context;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\EventLog\Framework\Repository;
|
|
||||||
|
|
||||||
use App\EventLog\Framework\Entity\EventLog;
|
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @extends ServiceEntityRepository<EventLog>
|
|
||||||
*/
|
|
||||||
class EventLogRepository extends ServiceEntityRepository
|
|
||||||
{
|
|
||||||
public function __construct(ManagerRegistry $registry)
|
|
||||||
{
|
|
||||||
parent::__construct($registry, EventLog::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function insert(
|
|
||||||
string $type,
|
|
||||||
string $message,
|
|
||||||
array $context = []
|
|
||||||
): EventLog {
|
|
||||||
$eventLog = new EventLog()
|
|
||||||
->setType($type)
|
|
||||||
->setMessage($message)
|
|
||||||
->setContext($context);
|
|
||||||
$this->getEntityManager()->persist($eventLog);
|
|
||||||
$this->getEntityManager()->flush();
|
|
||||||
return $eventLog;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -150,8 +150,6 @@ class TmdbClient
|
|||||||
$data['episode_count'] > 0;
|
$data['episode_count'] > 0;
|
||||||
})->map(function ($data) use ($media) {
|
})->map(function ($data) use ($media) {
|
||||||
return $this->tvSeasonDetails($media['id'], $data['season_number'])['episodes'];
|
return $this->tvSeasonDetails($media['id'], $data['season_number'])['episodes'];
|
||||||
})->rekey(function ($data) use ($media) {
|
|
||||||
return $data[1]['season_number'];
|
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
return $this->parseResult(
|
return $this->parseResult(
|
||||||
|
|||||||
@@ -21,32 +21,29 @@ class ResultFactory
|
|||||||
string $bingeGroup = "-",
|
string $bingeGroup = "-",
|
||||||
string $imdbId = "-",
|
string $imdbId = "-",
|
||||||
) {
|
) {
|
||||||
$title = trim(preg_replace('/\s+/', ' ', $title));
|
$ptn = (object) (new PTN())->parse($title);
|
||||||
$ptn = (object) new PTN()->parse(self::setFilename($url));
|
return new TorrentioResult(
|
||||||
$result = new TorrentioResult(
|
|
||||||
self::trimTitle($title),
|
self::trimTitle($title),
|
||||||
self::setUrl($url),
|
urldecode($url),
|
||||||
self::setFilename($url),
|
self::setFilename($url),
|
||||||
self::setSize($title),
|
self::setSize($title),
|
||||||
self::setSeeders($title),
|
self::setSeeders($title),
|
||||||
self::setProvider($title),
|
self::setProvider($title),
|
||||||
self::setEpisode($title),
|
self::setEpisode($title),
|
||||||
self::setSeason($ptn),
|
$ptn->season ?? "-",
|
||||||
$bingeGroup,
|
$bingeGroup,
|
||||||
self::setResolution($ptn),
|
$ptn->resolution ?? "-",
|
||||||
self::setCodec($ptn),
|
self::setCodec($ptn->codec ?? "-"),
|
||||||
self::setQuality($ptn),
|
$ptn->quality ?? "-",
|
||||||
$ptn,
|
$ptn,
|
||||||
self::setKey($url),
|
substr(base64_encode($url), strlen($url) - 10),
|
||||||
self::setEpisodeNumber($ptn),
|
$ptn->episode ?? "-",
|
||||||
self::setLanguages($title),
|
self::setLanguages($title),
|
||||||
self::setLanguageFlags($title),
|
self::setLanguageFlags($title),
|
||||||
false,
|
false,
|
||||||
uniqid(),
|
uniqid(),
|
||||||
$imdbId,
|
$imdbId,
|
||||||
);
|
);
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setFilename(string $url)
|
public static function setFilename(string $url)
|
||||||
@@ -55,11 +52,6 @@ class ResultFactory
|
|||||||
return end($file);
|
return end($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setUrl(string $url): string
|
|
||||||
{
|
|
||||||
return urldecode($url);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function setSize(string $title): string
|
public static function setSize(string $title): string
|
||||||
{
|
{
|
||||||
$sizeMatch = [];
|
$sizeMatch = [];
|
||||||
@@ -120,15 +112,9 @@ class ResultFactory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setCodec(object $ptn): string
|
public static function setCodec(string $codec): string
|
||||||
{
|
{
|
||||||
if (isset($ptn->codec) && array_key_exists($ptn->codec, self::$codecMap)) {
|
return self::$codecMap[strtolower($codec)] ?? $codec;
|
||||||
return self::$codecMap[strtolower($ptn->codec)];
|
|
||||||
} elseif (isset($ptn->codec)) {
|
|
||||||
return $ptn->codec;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "-";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function setEpisode(string $title)
|
private static function setEpisode(string $title)
|
||||||
@@ -138,36 +124,6 @@ class ResultFactory
|
|||||||
return array_key_exists(0, $value) ? strtoupper($value[0]) : "n/a";
|
return array_key_exists(0, $value) ? strtoupper($value[0]) : "n/a";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function setSeason(object $ptn): string
|
|
||||||
{
|
|
||||||
return $ptn->season ?? "-";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function setBingeGroup(string $bingeGroup): string
|
|
||||||
{
|
|
||||||
return $bingeGroup;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function setResolution(object $ptn): string
|
|
||||||
{
|
|
||||||
return $ptn->resolution ?? "-";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function setQuality(object $ptn): string
|
|
||||||
{
|
|
||||||
return $ptn->quality ?? "-";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function setKey(string $url): string
|
|
||||||
{
|
|
||||||
return substr(base64_encode($url), strlen($url) - 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function setEpisodeNumber(object $ptn): string
|
|
||||||
{
|
|
||||||
return $ptn->episode ?? "-";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static function trimTitle(string $title)
|
private static function trimTitle(string $title)
|
||||||
{
|
{
|
||||||
$emoji = \Emoji\detect_emoji($title);
|
$emoji = \Emoji\detect_emoji($title);
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ final class TvEpisodeList
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->reloadCount++;
|
$this->reloadCount++;
|
||||||
|
// dd(new TvEpisodePaginator()->paginate($results, $this->pageNumber, $this->perPage));
|
||||||
return new TvEpisodePaginator()->paginate($results, $this->pageNumber, $this->perPage);
|
return new TvEpisodePaginator()->paginate($results, $this->pageNumber, $this->perPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
>
|
>
|
||||||
<div class="p-4 md:p-6 flex flex-col gap-6 bg-orange-500/60 bg-clip-padding backdrop-filter backdrop-blur-md rounded-md">
|
<div class="p-4 md:p-6 flex flex-col gap-6 bg-orange-500/60 bg-clip-padding backdrop-filter backdrop-blur-md rounded-md">
|
||||||
<div class="flex flex-col md:flex-row gap-4">
|
<div class="flex flex-col md:flex-row gap-4">
|
||||||
{% if "jpg" in episode.poster %}
|
{% if episode.poster != null %}
|
||||||
<img class="w-full md:w-64 rounded-lg" src="{{ episode.poster }}" />
|
<img class="w-full md:w-64 rounded-lg" src="{{ episode.poster }}" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="w-full md:w-64 min-w-64 sticky h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
<div class="w-full md:w-64 min-w-64 sticky h-[144px] rounded-lg bg-gray-700 flex items-center justify-center">
|
||||||
|
|||||||
Reference in New Issue
Block a user