Do not write to DB if there aren't new episodes (#27)

This commit is contained in:
Olav Sundfør 2024-04-08 10:39:51 +02:00 committed by GitHub
parent 95d4ecd974
commit 0c2baf356b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,10 @@ async function updateFetch(existingSeries: Series) {
return !existingSeries.episodes.find((serieEpisode) => serieEpisode.id === episode.id);
});
if (newEpisodes.length === 0) {
return existingSeries;
}
const updated = {
...existingSeries,
lastFetch: new Date(),