Added:
- Monitoring chapters - possibilities for ToolBarButton.html.twig to have tailwind classes see ChapterListToolbar.php - Makefile scheduler command - Makefile make:message command
This commit is contained in:
@@ -81,7 +81,7 @@ class MangaController extends AbstractController
|
||||
|
||||
return $this->render('manga/show_chapters.html.twig', [
|
||||
'manga' => $manga,
|
||||
'toolbar' => $this->toolbarFactory->createToolbar('chapter_list', ['mangaId' => $manga->getId()])->getGroups(),
|
||||
'toolbar' => $this->toolbarFactory->createToolbar('chapter_list', ['mangaId' => $manga->getId(), 'isMonitored' => (int) $manga->isMonitored()])->getGroups(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -388,6 +388,22 @@ class MangaController extends AbstractController
|
||||
return new JsonResponse(['success' => 'Metadata refresh started...'], 200);
|
||||
}
|
||||
|
||||
#[Route('/toggle_monitored', name: 'toggle_monitored')]
|
||||
public function toogleMonitored(Request $request): JsonResponse
|
||||
{
|
||||
$id = json_decode($request->getContent(), true)['mangaId'];
|
||||
$manga = $this->mangaRepository->find($id);
|
||||
if (!$manga) {
|
||||
return new JsonResponse(['error' => 'Manga Not Found.'], 400);
|
||||
}
|
||||
|
||||
$manga->setMonitored(!$manga->isMonitored());
|
||||
$this->entityManager->persist($manga);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return new JsonResponse(['success' => 'Monitored status updated.', 'isMonitored' => $manga->isMonitored()], 200);
|
||||
}
|
||||
|
||||
private function isFullVolume(Chapter $chapter): bool
|
||||
{
|
||||
$volumeChapters = $this->chapterRepository->findBy([
|
||||
|
||||
Reference in New Issue
Block a user