Commit fcdd0e05 authored by echel0n's avatar echel0n

Added more UI notifications for version updater.

parent 971fc673
# Changelog
- * 291913e - 2018-11-12: Pre-Release v9.4.31.dev5
- * 2a2e9cf - 2018-11-12: Added more UI notifications for version updater.
- * 971fc67 - 2018-11-12: Pre-Release v9.4.31.dev5
- * 4d0d839 - 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
......
......@@ -63,21 +63,21 @@ class VersionUpdater(object):
return
sickrage.app.log.info("New update found for SiCKRAGE, starting auto-updater ...")
sickrage.app.alerts.message(_('New update found for SiCKRAGE, starting auto-updater'))
sickrage.app.alerts.message(_('Updater'), _('New update found for SiCKRAGE, starting auto-updater'))
if self.update():
sickrage.app.log.info("Update was successful!")
sickrage.app.alerts.message(_('Update was successful'))
sickrage.app.alerts.message(_('Updater'), _('Update was successful'))
sickrage.app.shutdown(restart=True)
else:
sickrage.app.log.info("Update failed!")
sickrage.app.alerts.message(_('Update failed!'))
sickrage.app.alerts.error(_('Updater'), _('Update failed!'))
finally:
self.amActive = False
def backup(self):
# Do a system backup before update
sickrage.app.log.info("Config backup in progress...")
sickrage.app.alerts.message(_('Backup'), _('Config backup in progress...'))
sickrage.app.alerts.message(_('Updater'), _('Config backup in progress...'))
try:
backupDir = os.path.join(sickrage.app.data_dir, 'backup')
if not os.path.isdir(backupDir):
......@@ -85,25 +85,27 @@ class VersionUpdater(object):
if backupSR(backupDir, keep_latest=True):
sickrage.app.log.info("Config backup successful, updating...")
sickrage.app.alerts.message(_('Backup'), _('Config backup successful, updating...'))
sickrage.app.alerts.message(_('Updater'), _('Config backup successful, updating...'))
return True
else:
sickrage.app.log.warning("Config backup failed, aborting update")
sickrage.app.alerts.message(_('Backup'), _('Config backup failed, aborting update'))
sickrage.app.alerts.error(_('Updater'), _('Config backup failed, aborting update'))
return False
except Exception as e:
sickrage.app.log.warning('Update: Config backup failed. Error: {}'.format(e))
sickrage.app.alerts.message(_('Backup'), _('Config backup failed, aborting update'))
sickrage.app.alerts.error(_('Updater'), _('Config backup failed, aborting update'))
return False
@staticmethod
def safe_to_update():
if sickrage.app.auto_postprocessor.amActive:
sickrage.app.log.debug("We can't proceed with updating, post-processor is running")
sickrage.app.alerts.message(_('Updater'), _("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")
sickrage.app.log.debug("Waiting for jobs in show queue to finish before updating")
sickrage.app.alerts.message(_('Updater'), _("Waiting for jobs in show queue to finish before updating"))
while sickrage.app.show_queue.is_busy:
sleep(1)
......@@ -182,8 +184,8 @@ class VersionUpdater(object):
return True
if webui:
sickrage.app.alerts.error(_("Update Failed"), _("Update wasn't successful, not restarting. Check your "
"log for more information."))
sickrage.app.alerts.error(_("Updater"), _("Update wasn't successful, not restarting. Check your "
"log for more information."))
@property
def version(self):
......@@ -474,6 +476,7 @@ class GitUpdateManager(UpdateManager):
self.current_branch))
if exit_status == 0:
sickrage.app.log.info("Updating SiCKRAGE from GIT servers")
sickrage.app.alerts.message(_('Updater'), _('Updating SiCKRAGE from GIT servers'))
Notifiers.mass_notify_version_update(self.get_newest_version)
self.install_requirements()
return True
......@@ -749,6 +752,7 @@ class PipUpdateManager(UpdateManager):
__, __, exit_status = self._pip_cmd(self._pip_path, 'install -U --no-cache-dir sickrage')
if exit_status == 0:
sickrage.app.log.info("Updating SiCKRAGE from PyPi servers")
sickrage.app.alerts.message(_('Updater'), _('Updating SiCKRAGE from PyPi servers'))
Notifiers.mass_notify_version_update(self.get_newest_version)
return True
......
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