Added:
- toogle chapter visibility - delete chapter cbz - preferred ContentSource.php and modal - minor fixes
This commit is contained in:
@@ -6,8 +6,8 @@ use App\Entity\ContentSource;
|
||||
use App\Message\DownloadChapter;
|
||||
use App\Repository\ChapterRepository;
|
||||
use App\Repository\ContentSourceRepository;
|
||||
use App\Service\MangaScraperService;
|
||||
use App\Service\NotificationService;
|
||||
use App\Service\Scraper\MangaScraperService;
|
||||
use Exception;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
@@ -40,7 +40,16 @@ readonly class DownloadChapterHandler
|
||||
throw new BadRequestHttpException('Chapter already downloaded');
|
||||
}
|
||||
|
||||
$sources = $this->contentSourceRepository->findAll();
|
||||
$manga = $chapter->getManga();
|
||||
$preferredSources = $manga->getPreferredSources()->toArray();
|
||||
$allSources = $this->contentSourceRepository->findAll();
|
||||
|
||||
$filteredSources = array_udiff($allSources, $preferredSources, function ($a, $b) {
|
||||
return $a->getId() - $b->getId();
|
||||
});
|
||||
|
||||
$sources = array_merge($preferredSources, $filteredSources);
|
||||
|
||||
$sources[] =
|
||||
(new ContentSource())
|
||||
->setBaseUrl('https://api.mangadex.org/')
|
||||
|
||||
Reference in New Issue
Block a user