Merge remote-tracking branch 'upstream/main' into feature-testing
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
This commit is contained in:
commit
d9480096f5
|
|
@ -23,7 +23,7 @@ type UpdatedSeries = {
|
||||||
lastFetch: Date;
|
lastFetch: Date;
|
||||||
episodes: Episode[];
|
episodes: Episode[];
|
||||||
} & Series;
|
} & Series;
|
||||||
async function updateFetch(existingSeries: Series): Promise<UpdatedSeries | null> {
|
async function updateFetch(existingSeries: Series): Promise<UpdatedSeries | Series | null> {
|
||||||
const series = await nrkRadio.getSeries(existingSeries.id);
|
const series = await nrkRadio.getSeries(existingSeries.id);
|
||||||
if (!series) {
|
if (!series) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -32,6 +32,10 @@ async function updateFetch(existingSeries: Series): Promise<UpdatedSeries | null
|
||||||
return !existingSeries.episodes.find((serieEpisode) => serieEpisode.id === episode.id);
|
return !existingSeries.episodes.find((serieEpisode) => serieEpisode.id === episode.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (newEpisodes.length === 0) {
|
||||||
|
return existingSeries;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since we don't control the API,
|
* Since we don't control the API,
|
||||||
* we should not make assumptions about the order,
|
* we should not make assumptions about the order,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue