a4k-openproject / plugin.video.openmeta

GNU General Public License v3.0
3 stars 3 forks source link

[Bug] TMDB Entries without a "release_date" crashes the whole search #67

Open firatakandere opened 4 years ago

firatakandere commented 4 years ago

Describe the bug The search crashed for TMDB when the json from TMDB api does not include "release_date" for an entry. Parsing error for a single entry should not cause the whole search to crash, maybe a better exception handling would be good to have.

To Reproduce Steps to reproduce the behavior:

  1. Go to Search
  2. Enter "ant" and search.
  3. Click TMDB Movies
  4. Search crashes.

Expected behavior Search happens.

Platform

Log File


                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: 'release_date'
                                            Traceback (most recent call last):
                                              File "/home/firat/.kodi/addons/plugin.video.openmeta/addon.py", line 157, in <module>
                                                plugin.run()
                                              File "/home/firat/.kodi/addons/plugin.video.openmeta/resources/lib/xswift2.py", line 917, in run
                                                items = self._dispatch(self.request.path)
                                              File "/home/firat/.kodi/addons/plugin.video.openmeta/resources/lib/xswift2.py", line 929, in _dispatch
                                                resp = view_func(**items)
                                              File "/home/firat/.kodi/addons/plugin.video.openmeta/resources/lib/nav_movies.py", line 209, in tmdb_movies_search_term
                                                return list_tmdb_items(result)
                                              File "/home/firat/.kodi/addons/plugin.video.openmeta/resources/lib/nav_movies.py", line 373, in list_tmdb_items
                                                movies = [meta_info.get_movie_metadata(item, None) for item in result['results']]
                                              File "/home/firat/.kodi/addons/plugin.video.openmeta/resources/lib/meta_info.py", line 12, in get_movie_metadata
                                                info['year'] = text.parse_year(movie['release_date'])
                                            KeyError: 'release_date'
                                            -->End of Python script error report<--
2020-06-09 23:48:49.273 T:140032770660096   ERROR: GetDirectory - Error getting plugin://plugin.video.openmeta/movies/tmdb/search_term/ant/1/
2020-06-09 23:48:49.285 T:140035975051968   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.openmeta/movies/tmdb/search_term/ant/1/) failed```