Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Emby test notification #4622

Merged
merged 2 commits into from
Jul 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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