Verified Commit 9abd6cea authored by Tijder's avatar Tijder
Browse files

Fix login failed without going to login screen #51

parent 285456d2
Pipeline #190080 passed with stage
in 12 minutes and 1 second
...@@ -57,6 +57,7 @@ class LoginView(Gtk.Box): ...@@ -57,6 +57,7 @@ class LoginView(Gtk.Box):
if (self._plex.has_token()): if (self._plex.has_token()):
self.__login_with_token() self.__login_with_token()
elif (self._plex.has_url()): elif (self._plex.has_url()):
self._try_token = True
self._plex.login_with_url(self._plex._server_url, self._plex._server_token) self._plex.login_with_url(self._plex._server_url, self._plex._server_token)
else: else:
self.emit('login-not-found') self.emit('login-not-found')
......
...@@ -124,7 +124,7 @@ class Plex(GObject.Object): ...@@ -124,7 +124,7 @@ class Plex(GObject.Object):
except: except:
self.emit('loading', _('Connecting to ') + baseurl + _(' failed.'), True) self.emit('loading', _('Connecting to ') + baseurl + _(' failed.'), True)
self.emit('login-status',False,'Login failed') self.emit('login-status',False,'Login failed')
print('connection failed') print('connection failed (login with url)')
def __save_config(self): def __save_config(self):
with open(self._config_dir + '/config', 'w') as file: with open(self._config_dir + '/config', 'w') as file:
...@@ -464,5 +464,5 @@ class Plex(GObject.Object): ...@@ -464,5 +464,5 @@ class Plex(GObject.Object):
return True return True
except: except:
self.emit('loading', _('Connecting to ') + resource.name + _(' failed.'), True) self.emit('loading', _('Connecting to ') + resource.name + _(' failed.'), True)
print('connection failed') print('connection failed (when trying to connect to resource)')
return False return False
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment