Commit 4d0d839f authored by echel0n's avatar echel0n

Pre-Release v9.4.31.dev4

parent 12f8ad6f
# Changelog
- * 232f6ad - 2018-11-12: Pre-Release v9.4.31.dev3
- * c08794a - 2018-11-12: Pre-Release v9.4.31.dev4
- * 12f8ad6 - 2018-11-12: Pre-Release v9.4.31.dev3
- * 82115fc - 2018-11-12: Pre-Release v9.4.31.dev2
- * bbac0e2 - 2018-11-12: Pre-Release v9.4.31.dev1
- * ae00748 - 2018-11-12: Updater now waits for show queue to finish before updating.
......
......@@ -33,6 +33,7 @@ from time import sleep
import sickrage
from sickrage.core.helpers import backupSR
from sickrage.core.websession import WebSession
from sickrage.core.websocket import WebSocketMessage
from sickrage.notifiers import Notifiers
......@@ -101,10 +102,10 @@ class VersionUpdater(object):
sickrage.app.log.debug("We can't proceed with updating, post-processor is running")
return False
# sickrage.app.show_queue.pause()
# sickrage.app.log.debug("Waiting for show queue jobs to finish")
# while sickrage.app.show_queue.is_busy:
# sleep(1)
sickrage.app.show_queue.pause()
sickrage.app.log.debug("Waiting for show queue jobs to finish")
while sickrage.app.show_queue.is_busy:
sleep(1)
return True
......@@ -148,7 +149,7 @@ class VersionUpdater(object):
self.updater.set_newest_text()
return True
def update(self):
def update(self, webui=False):
if self.updater:
# check if its safe to update
if not self.safe_to_update():
......@@ -173,8 +174,17 @@ class VersionUpdater(object):
sickrage.app.config.view_changelog = True
if webui:
sickrage.app.newest_version_string = None
WebSocketMessage('redirect', {
'url': '{}/home/restart/?pid={}'.format(sickrage.app.config.web_root, sickrage.app.pid)}).push()
return True
if webui:
sickrage.app.alerts.error(_("Update Failed"), _("Update wasn't successful, not restarting. Check your "
"log for more information."))
@property
def version(self):
if self.updater:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1084,13 +1084,11 @@ class Home(WebHandler):
if str(pid) != str(sickrage.app.pid):
return self.redirect("/{}/".format(sickrage.app.config.default_page))
if sickrage.app.version_updater.update():
sickrage.app.newest_version_string = None
return self.restart(pid)
else:
self._genericMessage(_("Update Failed"),
_("Update wasn't successful, not restarting. Check your log for more information."))
return self.redirect(self.previous_url())
sickrage.app.alerts.message(_('Updating SiCKRAGE'))
sickrage.app.event_queue.fire_event(sickrage.app.version_updater.update, webui=True)
return self.redirect(self.previous_url())
def verifyPath(self, path):
if os.path.isfile(path):
......@@ -1513,7 +1511,7 @@ class Home(WebHandler):
return map(str, warnings + errors)
if len(warnings) > 0:
sickrage.app.alerts.warning(
sickrage.app.alerts.message(
_('{num_warnings:d} warning{plural} while saving changes:').format(num_warnings=len(warnings),
plural="" if len(warnings) == 1 else "s"),
'<ul>' + '\n'.join(['<li>{0}</li>'.format(warning) for warning in warnings]) + "</ul>")
......
This diff is collapsed.
9.4.31.dev3
\ No newline at end of file
9.4.31.dev4
\ No newline at end of file
......@@ -43,6 +43,8 @@ $(document).ready(function ($) {
// Add handling for different kinds of events. For ex: {"event": "notification", "data": {"title": ..}}
if (msg.event === 'notification') {
SICKRAGE.notify(msg.data.type, msg.data.title, msg.data.body);
} else if (msg.event === 'redirect') {
window.location.href = msg.data.url;
}
};
},
......
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