Do not write to DB if there aren't new episodes
We currently do a lot of unessecary DB writes. This PR should fix that. This is important because it can get expensive rather quickly.
This commit is contained in:
parent
95d4ecd974
commit
d43ef65365
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue