self.kodi_helper = kodi_helper
self.netflix_session = netflix_session
self.credentials = self.kodi_helper.get_credentials()
+ self.profiles = []
self.video_list_cache = {}
+ self.prefetch_login()
- # check if we have stored credentials, if so, do the login before the user requests it
- # if that is done, we cache the profiles
+ def prefetch_login (self):
+ """Check if we have stored credentials.
+ If so, do the login before the user requests it
+ If that is done, we cache the profiles
+ """
if self.credentials['email'] != '' and self.credentials['password'] != '':
if self.netflix_session.is_logged_in(account=self.credentials):
self.netflix_session.refresh_session_data(account=self.credentials)
+ self.profiles = self.netflix_session.profiles
else:
self.netflix_session.login(account=self.credentials)
- self.profiles = self.netflix_session.profiles
+ self.profiles = self.netflix_session.profiles
else:
self.profiles = []
self.kodi_helper.log('Serving cached list for user: ' + self.netflix_session.user_data['guid'])
return cached_list
video_list_ids_raw = self.netflix_session.fetch_video_list_ids()
+
if 'error' in video_list_ids_raw:
return video_list_ids_raw
return self.netflix_session.parse_video_list_ids(response_data=video_list_ids_raw)