From 2b118304f043690573db3181d6b1dc8fd91daebd Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 18 Jul 2015 23:33:45 +0200 Subject: [PATCH] Server was being killed on state change before it could retrieve quote. --- data/interfaces/default/shutdown.html | 13 +------------ plexpy/webserve.py | 6 ++++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/data/interfaces/default/shutdown.html b/data/interfaces/default/shutdown.html index 3ff2cc57..05e3926a 100644 --- a/data/interfaces/default/shutdown.html +++ b/data/interfaces/default/shutdown.html @@ -25,7 +25,7 @@ @@ -45,16 +45,5 @@ function reloadPage() { window.location.href = "index"; } - - $(document).ready(function () { - $.ajax({ - url: 'random_arnold_quotes', - cache: false, - async: true, - success: function (data) { - $("#rquote").html(data); - } - }); - }); diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 17c89c9e..5a47cdc7 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -455,10 +455,12 @@ class WebInterface(object): @cherrypy.expose def do_state_change(self, signal, title, timer): - plexpy.SIGNAL = signal message = title + quote = self.random_arnold_quotes() + plexpy.SIGNAL = signal + return serve_template(templatename="shutdown.html", title=title, - message=message, timer=timer) + message=message, timer=timer, quote=quote) @cherrypy.expose def get_history(self, user=None, user_id=None, **kwargs):