Seasons with an episode with number 0 crash the episode search

If you search for an episode that is numbered 0 within its season, the episode searcher throws an internal server error. I found this out with this anime: http://trakt.tv/show/ladies-versus-butlers/season/1
I don’t believe the problem is anime-related per se, it seems to be because of the episode number 0.

Please provide debug logs showing the server error.

I believe this is the relevant part:

14-6-15 13:11:23.5|Error|TaskExtensions|Task Error

System.ArgumentOutOfRangeException: Can not search for an episode absolute episode number of zero
Parameter name: AbsoluteEpisodeNumber
at NzbDrone.Core.IndexerSearch.NzbSearchService.SearchAnime (NzbDrone.Core.Tv.Series series, NzbDrone.Core.Tv.Episode episode) [0x00000] in :0
at NzbDrone.Core.IndexerSearch.NzbSearchService.EpisodeSearch (NzbDrone.Core.Tv.Episode episode) [0x00000] in :0
at NzbDrone.Core.IndexerSearch.NzbSearchService.EpisodeSearch (Int32 episodeId) [0x00000] in :0
at NzbDrone.Core.IndexerSearch.MissingEpisodeSearchService.Execute (NzbDrone.Core.IndexerSearch.EpisodeSearchCommand message) [0x00000] in :0
at NzbDrone.Core.Messaging.Commands.CommandExecutor.ExecuteCommand[EpisodeSearchCommand] (NzbDrone.Core.Messaging.Commands.Command command) [0x00000] in :0

Its because there isn’t an absolute number associate with it, SxxE00 is considered a special.

What behavior for searching would be expected here?

The easy solution would be catching the exception and returning an empty list of search results. The funky solution would be adding a text field to that empty result so that you can type a manual search string and download the special that way. I realize that the latter is more time consuming so I’d just go with catching the exception instead of throwing it to the UI. :slight_smile:

Yeah, the latter also means a lot of work to allow for mapping a search result to a specific episode or episodes.

Pushed a fix to catch the exception and log an error.

Cool, I think that covers for all the weird exceptions in anime specials. :slight_smile: