Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed May 12, 2023
1 parent f1703bb commit b710bde
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Totoro.Core/Services/MyAnimeList/MyAnimeListService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,19 @@ public IObservable<IEnumerable<AnimeModel>> GetAiringAnime()

public async Task<IEnumerable<EpisodeModel>> GetEpisodes(long id)
{
var response = await _jikan.GetAnimeEpisodesAsync(id);

return response.Data.Select((x, index) => new EpisodeModel
try
{
EpisodeNumber = index + 1,
EpisodeTitle = x.Title
});
var response = await _jikan.GetAnimeEpisodesAsync(id);
return response.Data.Select((x, index) => new EpisodeModel
{
EpisodeNumber = index + 1,
EpisodeTitle = x.Title
});
}
catch
{
return Enumerable.Empty<EpisodeModel>();
}
}

private static MalApi.Season PrevSeason()
Expand Down

0 comments on commit b710bde

Please sign in to comment.