From 6484d9f01323ec112fc64f1130fee04d0750c821 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sun, 15 Oct 2017 19:13:41 +0100 Subject: [PATCH] Change after SG is updated, don't attempt to send a Plex client notifications if there is no client host set. Fix error after SG is updated and where Slack notifier is not enabled. --- CHANGES.md | 2 ++ sickbeard/notifiers/plex.py | 2 +- sickbeard/notifiers/slack.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5d9094e5..9ca79e83 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -114,6 +114,7 @@ * Change allow Cheetah template engine version 2 and newer * Change improve handling of relative download links from providers * Change enable TorrentBytes provider +* Change after SG is updated, don't attempt to send a Plex client notifications if there is no client host set [develop changelog] @@ -129,6 +130,7 @@ * Fix image not loaded from tvdb_api if there is only one poster/banner * Change prevent setting show/episode attr to None from indexer data * Fix article link color on some page were changed blue +* Fix error after SG is updated and where Slack notifier is not enabled ### 0.12.33 (2017-10-12 13:00:00 UTC) diff --git a/sickbeard/notifiers/plex.py b/sickbeard/notifiers/plex.py index c6fd6f51..170758f4 100644 --- a/sickbeard/notifiers/plex.py +++ b/sickbeard/notifiers/plex.py @@ -157,7 +157,7 @@ class PLEXNotifier: self._notify_pmc(ep_name + ': ' + lang, common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD]) def notify_git_update(self, new_version='??'): - if sickbeard.USE_PLEX: + if sickbeard.USE_PLEX and sickbeard.PLEX_HOST: update_text = common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] title = common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._notify_pmc(update_text + new_version, title) diff --git a/sickbeard/notifiers/slack.py b/sickbeard/notifiers/slack.py index 3ba77f7e..5dcfdc57 100644 --- a/sickbeard/notifiers/slack.py +++ b/sickbeard/notifiers/slack.py @@ -37,9 +37,9 @@ class SlackNotifier: ('icon_url', (icon_url, sickbeard.SLACK_ICON_URL or self.sg_logo_url)[not icon_url])])[custom]), json=True) - result = resp and resp['ok'] or resp['error'] + result = resp and resp.get('ok', resp.get('error')) or not (sickbeard.USE_SLACK or force) if True is not result: - logger.log(u'Slack failed sending message, response: "%s"' % resp['error'], logger.ERROR) + logger.log(u'Slack failed sending message, response: "%s"' % result, logger.ERROR) return result def _notify_str(self, pre_text, post_text):