TMDbLib
TMDbLib copied to clipboard
SearchMultiAsync() throws exception when media type of result is collection
When we use the SearchMultiAsync() and one of the result's media_type is collection. then a System.NullReferenceException is experienced.
To reproduce call the SearchMultiAsync with query = "Star Wars Collection" : `SearchMultiAsync("Star Wars Collection").
To check actual response from TMDB
curl --request GET \
--url 'https://api.themoviedb.org/3/search/multi?query=Star%20Wars%20Collection&include_adult=false&language=en-US&page=1' \
--header 'Authorization: Bearer <token here>' \
--header 'accept: application/json'
I have investigated some code and found that the error is thrown at https://github.com/jellyfin/TMDbLib/blob/7a6477ff48b000d2b7f488a8db964e9ddb8497b4/TMDbLib/Utilities/Converters/SearchBaseConverter.cs#L29
because the https://github.com/jellyfin/TMDbLib/blob/7a6477ff48b000d2b7f488a8db964e9ddb8497b4/TMDbLib/Objects/General/MediaType.cs class does not have a value for type "collection".