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.
This commit is contained in:
JackDandy 2017-10-15 19:13:41 +01:00
parent 5d0c71b402
commit 6484d9f013
3 changed files with 5 additions and 3 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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):