Added:
- turbo-stream for Chapter updates - progressbar for chapter scrapping - minor optimisations
This commit is contained in:
@@ -28,6 +28,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\Messenger\MessageBusInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Symfony\Component\String\Slugger\SluggerInterface;
|
||||
|
||||
class MangaController extends AbstractController
|
||||
|
||||
@@ -6,8 +6,10 @@ use App\Repository\ChapterRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\UX\Turbo\Attribute\Broadcast;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ChapterRepository::class)]
|
||||
#[Broadcast()]
|
||||
class Chapter
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
||||
@@ -7,6 +7,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
#[ORM\Entity(repositoryClass: MangaRepository::class)]
|
||||
class Manga
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App\Manager\Toolbar\Definition;
|
||||
|
||||
use App\Manager\Toolbar\Element\ToolbarElement;
|
||||
|
||||
class Toolbar
|
||||
abstract class Toolbar
|
||||
{
|
||||
private array $leftGroup = [];
|
||||
private array $rightGroup = [];
|
||||
|
||||
@@ -17,9 +17,9 @@ use Symfony\Component\Messenger\Attribute\AsMessageHandler;
|
||||
readonly class DownloadChapterHandler
|
||||
{
|
||||
public function __construct(
|
||||
private ChapterRepository $chapterRepository,
|
||||
private MangaScraperService $mangaScraperService,
|
||||
private NotificationService $notificationService,
|
||||
private ChapterRepository $chapterRepository,
|
||||
private MangaScraperService $mangaScraperService,
|
||||
private NotificationService $notificationService,
|
||||
private ContentSourceRepository $contentSourceRepository
|
||||
)
|
||||
{
|
||||
@@ -46,8 +46,7 @@ readonly class DownloadChapterHandler
|
||||
->setBaseUrl('https://api.mangadex.org/')
|
||||
->setImageSelector('img')
|
||||
->setChapterUrlFormat('at-home/server/%s')
|
||||
->setScrapingType('mangadex')
|
||||
;
|
||||
->setScrapingType('mangadex');
|
||||
|
||||
// (new ContentSource())
|
||||
// ->setBaseUrl('https://lelscans.net')
|
||||
|
||||
@@ -32,7 +32,7 @@ readonly class RefreshMetadataHandler
|
||||
$lastChapters = $this->mangadexProvider->addAllChaptersToManga($manga);
|
||||
|
||||
try {
|
||||
foreach ($manga->getChapters() as $chapter) {
|
||||
foreach ($lastChapters as $chapter) {
|
||||
$this->entityManager->persist($chapter);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user