- cache_id = 'season_' + show_id
- if self.kodi_helper.has_cached_item(cache_id=cache_id):
- season_list = self.kodi_helper.get_cached_item(cache_id=cache_id)
- else:
- season_list = self.call_netflix_service({'method': 'fetch_seasons_for_show', 'show_id': show_id})
- # check for any errors
- if self._is_dirty_response(response=season_list):
- return False
- # check if we have sesons, announced shows that are not available yet have none
- if len(season_list) == 0:
- return self.kodi_helper.build_no_seasons_available()
- # parse the seasons raw response from Netflix
- self.kodi_helper.add_cached_item(cache_id=cache_id, contents=season_list)
+ user_data = self.call_netflix_service({'method': 'get_user_data'})
+ season_list = self.call_netflix_service({'method': 'fetch_seasons_for_show', 'show_id': show_id, 'guid': user_data['guid'], 'cache': True})
+ # check for any errors
+ if self._is_dirty_response(response=season_list):
+ return False
+ # check if we have sesons, announced shows that are not available yet have none
+ if len(season_list) == 0:
+ return self.kodi_helper.build_no_seasons_available()