Skip to content

Commit

Permalink
filter out null entries in list
Browse files Browse the repository at this point in the history
list can appear in the form:
```
[null, null {...}]
```
when anilist api does not return `episodeCount` number of episodes.

In the case of One Piece (ThaUnknown#568), only ep. 1122 is returned from the api,
leaving 1121 null's in the list before the first entry with actual
episode data
  • Loading branch information
2547techno committed Dec 11, 2024
1 parent 6a8d0cb commit 0563c2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/views/ViewAnime/EpisodeList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
const animeProgress = liveAnimeProgress(id)
</script>
{#each episodeOrder ? episodeList : [...episodeList].reverse() as { episode, image, summary, rating, title, length, airdate, filler }}
{#each episodeOrder ? episodeList.filter(e => e) : [...episodeList].reverse().filter(e => e) as { episode, image, summary, rating, title, length, airdate, filler }}
{@const completed = !watched && userProgress >= episode}
{@const target = userProgress + 1 === episode}
{@const progress = !watched && ($animeProgress?.[episode] ?? 0)}
Expand Down

0 comments on commit 0563c2f

Please sign in to comment.