Skip to content

Commit

Permalink
Fix Emby test notification (#4622)
Browse files Browse the repository at this point in the history
* Fix emby test notification

* Update changelog
  • Loading branch information
sharkykh authored and medariox committed Jul 7, 2018
1 parent 0518a60 commit f4c6830
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

**Fixes**

- Fixed Emby test notification ([#4622](https://github.com/pymedusa/Medusa/pull/4622))
- _Simple message describing the fix, and a link to the pull request._

### [**Previous versions**](https://github.com/pymedusa/medusa.github.io/blob/master/news/CHANGES.md)
16 changes: 9 additions & 7 deletions medusa/notifiers/emby.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Emby notifier module."""
from __future__ import unicode_literals

import json
import logging

from medusa import app
Expand All @@ -14,7 +15,7 @@

from requests.exceptions import HTTPError, RequestException

from six import text_type as str
from six import text_type

log = BraceAdapter(logging.getLogger(__name__))
log.logger.addHandler(logging.NullHandler())
Expand All @@ -39,14 +40,15 @@ def _notify_emby(self, message, host=None, emby_apikey=None):
emby_apikey = app.EMBY_APIKEY

url = 'http://{host}/emby/Notifications/Admin'.format(host=host)
data = json.dumps({
'Name': 'Medusa',
'Description': message,
'ImageUrl': app.LOGO_URL
})
try:
resp = self.session.post(
url=url,
data={
'Name': 'Medusa',
'Description': message,
'ImageUrl': app.LOGO_URL
},
data=data,
headers={
'X-MediaBrowser-Token': emby_apikey,
'Content-Type': 'application/json'
Expand Down Expand Up @@ -110,7 +112,7 @@ def update_library(self, show=None):
return False

params = {
provider: str(tvdb_id)
provider: text_type(tvdb_id)
}
else:
params = {}
Expand Down

0 comments on commit f4c6830

Please sign in to comment.