update torrent features

This commit is contained in:
ghost 2023-10-13 00:08:45 +03:00
parent d1f8c126b0
commit e713c17333
16 changed files with 661 additions and 329 deletions

View file

@ -6,7 +6,6 @@ use App\Repository\TorrentRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
// @TODO #[ORM\Index(columns: ['keywords'], name: 'keywords_idx', flags: ['fulltext'])]
#[ORM\Entity(repositoryClass: TorrentRepository::class)]
class Torrent
@ -25,14 +24,20 @@ class Torrent
#[ORM\Column(nullable: true)]
private ?int $scraped = null;
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
private array $locales = [];
#[ORM\Column]
private ?bool $sensitive = null;
#[ORM\Column]
private ?bool $approved = null;
#[ORM\Column(length: 32)]
private ?string $md5file = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $keywords = null;
#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]
private ?array $keywords = null;
#[ORM\Column(nullable: true)]
private ?int $seeders = null;
@ -103,18 +108,42 @@ class Torrent
return $this;
}
public function getKeywords(): ?string
public function getKeywords(): ?array
{
return $this->keywords;
}
public function setKeywords(?string $keywords): static
public function setKeywords(?array $keywords): static
{
$this->keywords = $keywords;
return $this;
}
public function getLocales(): array
{
return $this->locales;
}
public function setLocales(array $locales): static
{
$this->locales = $locales;
return $this;
}
public function isSensitive(): ?bool
{
return $this->sensitive;
}
public function setSensitive(bool $sensitive): static
{
$this->sensitive = $sensitive;
return $this;
}
public function isApproved(): ?bool
{
return $this->approved;

View file

@ -23,7 +23,7 @@ class TorrentLocales
#[ORM\Column]
private ?int $added = null;
#[ORM\Column(type: Types::ARRAY)]
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
private array $value = [];
#[ORM\Column]

View file

@ -32,10 +32,10 @@ class User
#[ORM\Column(length: 2)]
private ?string $locale = null;
#[ORM\Column(type: Types::ARRAY)]
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
private array $locales = [];
#[ORM\Column(type: Types::ARRAY)]
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
private array $events = [];
#[ORM\Column(length: 255)]