Compare commits
1 Commits
969f4569f5
...
feature/up
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81fc713149 |
@@ -108,6 +108,9 @@ RUN composer install --no-cache --prefer-dist --no-dev --no-autoloader --no-scri
|
|||||||
FROM node:22-alpine AS node_build
|
FROM node:22-alpine AS node_build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --link package.json package-lock.json ./
|
COPY --link package.json package-lock.json ./
|
||||||
|
COPY --from=composer_deps /app/vendor/symfony/ux-live-component/assets ./vendor/symfony/ux-live-component/assets
|
||||||
|
COPY --from=composer_deps /app/vendor/symfony/ux-react/assets ./vendor/symfony/ux-react/assets
|
||||||
|
COPY --from=composer_deps /app/vendor/symfony/ux-turbo/assets ./vendor/symfony/ux-turbo/assets
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY --link assets ./assets
|
COPY --link assets ./assets
|
||||||
COPY --link webpack.config.js ./
|
COPY --link webpack.config.js ./
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
chapterId: chapter.id
|
chapterId: chapter.id
|
||||||
}
|
}
|
||||||
}">
|
}">
|
||||||
<template v-if="chapter.isVolumeGroup && chapter.volumeChapterCount > 1">
|
<template v-if="chapter.isVolumeGroup">
|
||||||
Chapitres {{ chapter.volumeChaptersRange }}
|
{{ chapter.volumeChapterCount > 1 ? 'Chapitres ' : 'Chapitre ' }}{{ chapter.volumeChaptersRange }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
||||||
</router-link>
|
</router-link>
|
||||||
<span v-else class="text-gray-500 dark:text-gray-400">
|
<span v-else class="text-gray-500 dark:text-gray-400">
|
||||||
<template v-if="chapter.isVolumeGroup && chapter.volumeChapterCount > 1">
|
<template v-if="chapter.isVolumeGroup">
|
||||||
Chapitres {{ chapter.volumeChaptersRange }}
|
{{ chapter.volumeChapterCount > 1 ? 'Chapitres ' : 'Chapitre ' }}{{ chapter.volumeChaptersRange }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
<template v-else>{{ chapter.title || 'Sans titre' }}</template>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ when@test:
|
|||||||
when@prod:
|
when@prod:
|
||||||
doctrine:
|
doctrine:
|
||||||
orm:
|
orm:
|
||||||
|
auto_generate_proxy_classes: false
|
||||||
|
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
|
||||||
query_cache_driver:
|
query_cache_driver:
|
||||||
type: pool
|
type: pool
|
||||||
pool: doctrine.system_cache_pool
|
pool: doctrine.system_cache_pool
|
||||||
|
|||||||
@@ -53,13 +53,6 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Vider le cache prod stale avant le démarrage des workers FrankenPHP.
|
|
||||||
# Sans ça, les workers chargent l'ancien cache du volume Docker et crashent
|
|
||||||
# en boucle si les classes du cache ne correspondent plus à la version déployée.
|
|
||||||
if [ "$APP_ENV" = "prod" ]; then
|
|
||||||
rm -rf var/cache/prod
|
|
||||||
fi
|
|
||||||
|
|
||||||
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
||||||
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
worker {
|
worker {
|
||||||
file ./public/index.php
|
file ./public/index.php
|
||||||
num 2
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,26 +26,18 @@ readonly class RefreshMangaChaptersHandler
|
|||||||
throw new \RuntimeException('Manga not found');
|
throw new \RuntimeException('Manga not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Synchronisation + récupération des numéros de nouveaux chapitres
|
// Synchronisation + récupération des nouveaux IDs
|
||||||
$newChapterNumbers = $this->chapterSynchronizationService->synchronizeChapters($manga);
|
$newChapterIds = $this->chapterSynchronizationService->synchronizeChapters($manga);
|
||||||
|
|
||||||
// Mise à jour de la date de monitoring
|
// Mise à jour de la date de monitoring
|
||||||
$manga->updateLastMonitoringCheck(new \DateTimeImmutable());
|
$manga->updateLastMonitoringCheck(new \DateTimeImmutable());
|
||||||
$this->mangaRepository->save($manga);
|
$this->mangaRepository->save($manga);
|
||||||
|
|
||||||
// Événement de scraping pour chaque nouveau chapitre
|
// Événement de scraping pour chaque nouveau chapitre
|
||||||
// On retrouve l'ID réel (PK integer) après save() car le chapitre n'a
|
foreach ($newChapterIds as $chapterId) {
|
||||||
// son identifiant définitif qu'une fois persisté en base.
|
|
||||||
foreach ($newChapterNumbers as $chapterNumber) {
|
|
||||||
$saved = $this->mangaRepository->findChapterByMangaIdAndNumber(
|
|
||||||
$manga->getId()->getValue(),
|
|
||||||
$chapterNumber
|
|
||||||
);
|
|
||||||
if ($saved) {
|
|
||||||
$this->eventBus->dispatch(
|
$this->eventBus->dispatch(
|
||||||
new ChapterReadyForScraping(new ChapterId($saved->getId()))
|
new ChapterReadyForScraping(new ChapterId($chapterId))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ interface ChapterSynchronizationServiceInterface
|
|||||||
/**
|
/**
|
||||||
* Synchronise les chapitres d'un manga depuis la source externe.
|
* Synchronise les chapitres d'un manga depuis la source externe.
|
||||||
*
|
*
|
||||||
* @return float[] Numéros des nouveaux chapitres ajoutés
|
* @return string[] IDs des nouveaux chapitres ajoutés
|
||||||
*/
|
*/
|
||||||
public function synchronizeChapters(Manga $manga): array;
|
public function synchronizeChapters(Manga $manga): array;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,11 +96,11 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
|||||||
|
|
||||||
$newChapterIds = [];
|
$newChapterIds = [];
|
||||||
|
|
||||||
// Sauvegarde uniquement les nouveaux chapitres et collecte leurs numéros
|
// Sauvegarde uniquement les nouveaux chapitres et collecte leurs IDs
|
||||||
foreach ($chaptersByNumber as $chapterNumber => $chapter) {
|
foreach ($chaptersByNumber as $chapterNumber => $chapter) {
|
||||||
if (!isset($existingChapters[(float) $chapterNumber])) {
|
if (!isset($existingChapters[(float) $chapterNumber])) {
|
||||||
$manga->addChapter($chapter);
|
$manga->addChapter($chapter);
|
||||||
$newChapterIds[] = $chapter->getNumber();
|
$newChapterIds[] = $chapter->getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ class InMemoryChapterSynchronizationService implements ChapterSynchronizationSer
|
|||||||
'synchronized_at' => new \DateTimeImmutable(),
|
'synchronized_at' => new \DateTimeImmutable(),
|
||||||
];
|
];
|
||||||
|
|
||||||
// Retourne les numéros des chapitres synchronisés (simulation)
|
// Retourne les IDs des chapitres synchronisés (simulation)
|
||||||
return [1.0, 2.0];
|
return ['chapter-1', 'chapter-2'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user