- FileSystemManager.php refactoring of all write/read actions on filesystem

Deleted:
- old ToolbarManager.php
This commit is contained in:
Jérémy Guillot
2024-07-24 17:21:44 +02:00
parent 7068bd1a34
commit 7eba0981c8
10 changed files with 142 additions and 197 deletions

View File

@@ -13,17 +13,6 @@ use Symfony\Component\DomCrawler\Crawler;
class HtmlScraper extends AbstractScraper
{
private Client $client;
public function __construct(
string $projectDir,
EventDispatcherInterface $eventDispatcher,
EntityManagerInterface $entityManager
) {
parent::__construct($projectDir, $eventDispatcher, $entityManager);
$this->client = new Client();
}
/**
* @throws Exception
* @throws GuzzleException
@@ -64,7 +53,7 @@ class HtmlScraper extends AbstractScraper
}
$cbzFilePath = $this->generateCbzPath($manga, $chapter);
$this->createCbzFile($tempDir, $pageData, $cbzFilePath);
$this->createCbzFile($pageData, $cbzFilePath);
$chapter->setCbzPath($cbzFilePath);
$this->entityManager->persist($chapter);
@@ -144,7 +133,7 @@ class HtmlScraper extends AbstractScraper
private function fetchHtml(string $url): string
{
try {
$response = $this->client->get($url, [
$response = $this->httpClient->get($url, [
'http_errors' => true,
'allow_redirects' => false
]);