From 418b879abe3af5db9fdb31c823320cb3b2d41b17 Mon Sep 17 00:00:00 2001 From: TheHumanRobot <75536101+TheHumanRobot@users.noreply.github.com> Date: Sun, 9 Jan 2022 19:15:58 -0500 Subject: [PATCH] Update Preroll.py --- Preroll.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/Preroll.py b/Preroll.py index b296059..b3e57b2 100644 --- a/Preroll.py +++ b/Preroll.py @@ -32,7 +32,7 @@ button_base64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAAoCAYAAAA16 class Rollarr(App): - os.chdir('/rollar/') + os.chdir('/rollarr/') if exists('data.json'): print('ready') else: @@ -116,6 +116,10 @@ class Rollarr(App): self.container.append(self.btFileDiag) self.container.append(self.default) self.container.append(gui.Label(" ", height=40)) + self.Test = gui.Button('Test Connection', width=110, height=20) + self.Test.onclick.do(self.testconnection) + self.container.append(self.Test) + self.container.append(gui.Label(" ", height=20)) self.save = gui.Button('Save', width=50, height=20) self.submit = gui.Button('Submit', width=50, height=20) self.submission.append(self.save) @@ -1119,10 +1123,24 @@ class Rollarr(App): self.popup.show(self) PrerollUpdate.update() - - + def testconnection(self, widget): + session = requests.Session() + session.verify = False + requests.packages.urllib3.disable_warnings() + plex = PlexServer(self.url.get_value(), self.Token.get_value(), session, timeout=None) + print(plex.account()) + self.popupconnected = gui.GenericDialog("Your sever is connected") + self.popupconnectedfail = gui.GenericDialog("Connection error please check logs") + if plex.account() != None: + self.popupconnected.show(self) + else: + self.popupconnectedfail.show(self) if __name__ == "__main__": start(Rollarr,address='0.0.0.0', port=3100, start_browser=True, multiple_instance=True) + + + +