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;
|
||||
episodes: Episode[];
|
||||
} & 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);
|
||||
if (!series) {
|
||||
return null;
|
||||
|
|
@ -32,6 +32,10 @@ async function updateFetch(existingSeries: Series): Promise<UpdatedSeries | null
|
|||
return !existingSeries.episodes.find((serieEpisode) => serieEpisode.id === episode.id);
|
||||
});
|
||||
|
||||
if (newEpisodes.length === 0) {
|
||||
return existingSeries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Since we don't control the API,
|
||||
* we should not make assumptions about the order,
|
||||
|
|
|
|||
Loading…
Reference in New Issue