chore(performance): Adds string parser for inline JS data & performacne profiler...
[plugin.video.netflix.git] / resources / lib / Navigation.py
index 16c0a6d0b26ae20c581c7cbe1198094d55428d69..79efa598d22ec16fd6dec18aa78ede59b447abc8 100644 (file)
@@ -69,7 +69,7 @@ class Navigation:
             return False
         if 'action' not in params.keys():
             # show the profiles
-            self.show_profiles()
+            return self.show_profiles()
         elif params['action'] == 'video_lists':
             # list lists that contain other lists (starting point with recommendations, search, etc.)
             return self.show_video_lists()
@@ -157,10 +157,11 @@ class Navigation:
                 if self.netflix_session._is_size_key(key=key) == False:
                     has_search_results = search_results_raw['value']['search'][key]['titles']['length'] > 0
                     if has_search_results == False:
-                        for entry in search_results_raw['value']['search'][key]['suggestions']:
-                            if self.netflix_session._is_size_key(key=entry) == False:
-                                if search_results_raw['value']['search'][key]['suggestions'][entry]['relatedvideos']['length'] > 0:
-                                    has_search_results = True
+                        if search_results_raw['value']['search'][key].get('suggestions', False) != False:
+                            for entry in search_results_raw['value']['search'][key]['suggestions']:
+                                if self.netflix_session._is_size_key(key=entry) == False:
+                                    if search_results_raw['value']['search'][key]['suggestions'][entry]['relatedvideos']['length'] > 0:
+                                        has_search_results = True
 
 
         # display that we haven't found a thing
@@ -252,7 +253,7 @@ class Navigation:
         # sort seasons by index by default (they´re coming back unsorted from the api)
         seasons_sorted = []
         for season_id in season_list:
-            seasons_sorted.append(int(season_list[season_id]['id']))
+            seasons_sorted.append(int(season_list[season_id]['idx']))
             seasons_sorted.sort()
         return self.kodi_helper.build_season_listing(seasons_sorted=seasons_sorted, season_list=season_list, build_url=self.build_url)