Commit dd00ab83 authored by echel0n's avatar echel0n

Merge branch 'release/9.4.34'

parents 1423f4a4 70d42c24
# Changelog
- * 720e6c3 - 2018-11-12: Release v9.4.32
- * fbe6cd3 - 2018-11-14: Release v9.4.34
- * 4478e39 - 2018-11-14: Release v9.4.33
- * 26b7be1 - 2018-11-14: Fixed NoneType issue with delete and update database function calls.
- * aaf7acf - 2018-11-12: Refactored new version string to web socket message.
- * d831f6f - 2018-11-12: Release v9.4.32
- * f298b17 - 2018-11-12: Refactored speed.cd torrent provider to use cookie login.
- * 2abdafe - 2018-11-12: Release v9.4.31
- * fcdd0e0 - 2018-11-12: Added more UI notifications for version updater.
......
......@@ -95,7 +95,6 @@ class Core(object):
self.web_port = None
self.developer = None
self.debug = None
self.newest_version = None
self.newest_version_string = None
self.naming_ep_type = ("%(seasonnumber)dx%(episodenumber)02d",
......@@ -473,7 +472,7 @@ class Core(object):
self.wserver.start()
# fire off startup events
self.event_queue.fire_event(self.version_updater.run, force=True)
self.event_queue.fire_event(self.version_updater.run)
self.event_queue.fire_event(self.tz_updater.run)
# start ioloop
......
......@@ -83,7 +83,9 @@ class BlackAndWhiteList(object):
:param table: database table remove keywords from
"""
sickrage.app.main_db.delete(sickrage.app.main_db.get(table, self.show_id))
dbData = sickrage.app.main_db.get(table, self.show_id)
if dbData:
sickrage.app.main_db.delete(sickrage.app.main_db.get(table, self.show_id))
def _load_list(self, table):
......
......@@ -163,5 +163,6 @@ class BacklogSearcher(object):
sickrage.app.log.debug("Setting the last backlog in the DB to {}".format(when))
dbData = sickrage.app.main_db.get('tv_shows', showid)
dbData['last_backlog_search'] = when
sickrage.app.main_db.update(dbData)
if dbData:
dbData['last_backlog_search'] = when
sickrage.app.main_db.update(dbData)
\ No newline at end of file
......@@ -295,8 +295,9 @@ class ProperSearcher(object):
sickrage.app.log.debug("Setting the last proper search in database to " + str(when))
dbData = sickrage.app.main_db.get('tv_shows', showid)
dbData['last_proper_search'] = when
sickrage.app.main_db.update(dbData)
if dbData:
dbData['last_proper_search'] = when
sickrage.app.main_db.update(dbData)
@staticmethod
def _get_lastProperSearch(showid):
......
......@@ -1043,7 +1043,8 @@ class TVShow(object):
sickrage.app.main_db.insert(imdb_info)
except RevConflict:
dbData = sickrage.app.main_db.get('imdb_info', self.indexerid)
sickrage.app.main_db.delete(dbData)
if dbData:
sickrage.app.main_db.delete(dbData)
imdb_info.update(self.imdb_info)
sickrage.app.main_db.insert(imdb_info)
......
......@@ -63,21 +63,25 @@ class VersionUpdater(object):
return
sickrage.app.log.info("New update found for SiCKRAGE, starting auto-updater ...")
sickrage.app.alerts.message(_('Updater'), _('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(_('Updater'), _('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.error(_('Updater'), _('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(_('Updater'), _('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,27 +89,32 @@ class VersionUpdater(object):
if backupSR(backupDir, keep_latest=True):
sickrage.app.log.info("Config backup successful, updating...")
sickrage.app.alerts.message(_('Updater'), _('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.error(_('Updater'), _('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.error(_('Updater'), _('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"))
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 jobs in show queue to finish before updating")
sickrage.app.alerts.message(_('Updater'), _("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)
......@@ -177,15 +186,14 @@ 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()
WebSocketMessage('task', {'cmd': 'restart'}).push()
return True
if webui:
sickrage.app.alerts.error(_("Updater"), _("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):
......@@ -242,10 +250,7 @@ class UpdateManager(object):
# Still haven't found a working git
error_message = _('Unable to find your git executable - Set your git path from Settings->General->Advanced OR '
'delete your .git folder and run from source to enable updates.')
sickrage.app.newest_version_string = error_message
return None
sickrage.app.alerts.error(_('Updater'), error_message)
@property
def _pip_path(self):
......@@ -288,9 +293,7 @@ class UpdateManager(object):
# Still haven't found a working git
error_message = _('Unable to find your pip executable - Set your pip path from Settings->General->Advanced')
sickrage.app.newest_version_string = error_message
return None
sickrage.app.alerts.error(_('Updater'), error_message)
@staticmethod
def _git_cmd(git_path, args):
......@@ -444,14 +447,10 @@ class GitUpdateManager(UpdateManager):
return output.strip()
def set_newest_text(self):
# if we're up to date then don't set this
sickrage.app.newest_version_string = None
if self.version != self.get_newest_version:
newest_text = _(
'There is a newer version available, version {} &mdash; <a href=\"{}\">Update Now</a>').format(
self.get_newest_version, self.get_update_url())
sickrage.app.newest_version_string = newest_text
def need_update(self):
......@@ -476,7 +475,8 @@ 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'))
sickrage.app.alerts.message(_('Updater'),
_('Updating SiCKRAGE from GIT servers'))
Notifiers.mass_notify_version_update(self.get_newest_version)
self.install_requirements()
return True
......@@ -576,19 +576,12 @@ class SourceUpdateManager(UpdateManager):
return self._find_installed_version()
def set_newest_text(self):
# if we're up to date then don't set this
sickrage.app.newest_version_string = None
if not self.version:
sickrage.app.log.debug("Unknown current version number, don't know if we should update or not")
return
newest_text = _("Unknown current version number: If yo've never used the SiCKRAGE upgrade system before "
"then current version is not set. &mdash; "
"<a href=\"{}\">Update Now</a>").format(self.get_update_url())
else:
newest_text = _("There is a newer version available, version {} &mdash; "
"<a href=\"{}\">Update Now</a>").format(self.get_newest_version, self.get_update_url())
newest_text = _("There is a newer version available, version {} &mdash; "
"<a href=\"{}\">Update Now</a>").format(self.get_newest_version, self.get_update_url())
sickrage.app.newest_version_string = newest_text
def update(self):
......@@ -732,17 +725,12 @@ class PipUpdateManager(UpdateManager):
return self._find_installed_version()
def set_newest_text(self):
# if we're up to date then don't set this
sickrage.app.newest_version_string = None
if not self.version:
sickrage.app.log.debug("Unknown current version number, don't know if we should update or not")
return
else:
newest_text = _("New SiCKRAGE update found on PyPi servers, version {} &mdash; "
"<a href=\"{}\">Update Now</a>").format(self.get_newest_version, self.get_update_url())
newest_text = _("New SiCKRAGE update found on PyPi servers, version {} &mdash; "
"<a href=\"{}\">Update Now</a>").format(self.get_newest_version, self.get_update_url())
sickrage.app.newest_version_string = newest_text
def update(self):
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1074,9 +1074,11 @@ class Home(WebHandler):
if str(pid) != str(sickrage.app.pid):
return self.redirect("/{}/".format(sickrage.app.config.default_page))
sickrage.app.alerts.message(_("Updater"), _('Checking for updates'))
# check for new app updates
if not sickrage.app.version_updater.check_for_new_version(True):
sickrage.app.alerts.message(_('No new updates!'))
if not sickrage.app.version_updater.check_for_new_version(force=True):
sickrage.app.alerts.message(_("Updater"), _('No new updates available!'))
return self.redirect(self.previous_url())
......@@ -1084,7 +1086,7 @@ class Home(WebHandler):
if str(pid) != str(sickrage.app.pid):
return self.redirect("/{}/".format(sickrage.app.config.default_page))
sickrage.app.alerts.message(_('Updating SiCKRAGE'))
sickrage.app.alerts.message(_("Updater"), _('Updating SiCKRAGE'))
sickrage.app.event_queue.fire_event(sickrage.app.version_updater.update, webui=True)
......@@ -1513,7 +1515,8 @@ class Home(WebHandler):
if len(warnings) > 0:
sickrage.app.alerts.message(
_('{num_warnings:d} warning{plural} while saving changes:').format(num_warnings=len(warnings),
plural="" if len(warnings) == 1 else "s"),
plural="" if len(
warnings) == 1 else "s"),
'<ul>' + '\n'.join(['<li>{0}</li>'.format(warning) for warning in warnings]) + "</ul>")
if len(errors) > 0:
......@@ -2015,7 +2018,8 @@ class Home(WebHandler):
'searchstatus': searchstatus,
'status': statusStrings[epObj.status],
'quality': self.getQualityClass(epObj),
'overview': Overview.overviewStrings[showObj.get_overview(int(epObj.status or -1))]})
'overview': Overview.overviewStrings[
showObj.get_overview(int(epObj.status or -1))]})
return results
......
......@@ -6,8 +6,7 @@
<div class="modal-header bg-secondary">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div>
<div class="modal-body">
</div>
<div class="modal-body"></div>
</div>
</div>
</div>
......@@ -18,8 +17,7 @@
<div class="modal-header bg-secondary">
<h3 class="modal-title"></h3>
</div>
<div class="modal-body">
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<input type="button" class="btn btn-success" value="${_('Ok')}"/>
<input type="button" class="btn btn-danger" value="${_('Cancel')}" data-dismiss="modal"/>
......@@ -61,8 +59,12 @@
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal" data-toggle="modal" href="#manualSearchModalQuality">${_('No')}</button>
<button type="button" class="btn btn-success" data-dismiss="modal" data-toggle="modal" href="#manualSearchModalQuality">${_('Yes')}</button>
<button type="button" class="btn btn-danger" data-dismiss="modal" data-toggle="modal"
href="#manualSearchModalQuality">${_('No')}
</button>
<button type="button" class="btn btn-success" data-dismiss="modal" data-toggle="modal"
href="#manualSearchModalQuality">${_('Yes')}
</button>
</div>
</div>
</div>
......
......@@ -18,8 +18,11 @@ class WebSocketUIHandler(WebSocketHandler):
"""Client connected to the WebSocket."""
clients.add(self)
#for n in sickrage.app.alerts.get_notifications(self.request.remote_ip):
# self.write_message(WebSocketMessage('notification', n.data).json())
# for n in sickrage.app.alerts.get_notifications(self.request.remote_ip):
# try:
# self.write_message(WebSocketMessage('notification', n.data).json())
# except WebSocketClosedError:
# pass
def on_message(self, message):
"""Received a message from the client."""
......
This diff is collapsed.
9.4.32
\ No newline at end of file
9.4.34
\ No newline at end of file
......@@ -43,8 +43,12 @@ $(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;
} else if (msg.event === 'task') {
switch (msg.data.cmd) {
case 'restart':
window.location.href = SICKRAGE.srWebRoot + '/home/restart/?pid=' + SICKRAGE.srPID;
break;
}
}
};
},
......
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