ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
386 stars 75 forks source link

Fix unknown episode air date null exception #1142

Closed cxooda closed 1 month ago

cxooda commented 1 month ago

Fix exception that would be thrown if the episode had an unknown air/release date according to AniDB (example: https://anidb.net/episode/132080) which would result airdate to be null

This change will use the series air date if the episode doesn't have one.

Additionally, if the series also doesn't have one, the air date will be omitted. (Luckily, as of today, no such case exists on AniDB, however, if such a thing was to be added in the future, it would also cause an exception here. I'm not exactly sure whether in this super edge case scenario, it should just throw an exception here, but I suppose that if such an edge case were to be handled, it would happen before it gets passed into function. So I am assuming that if both the EP and anime air date is null at this point, that just means that both are unknown.)