Skip to content

Commit

Permalink
Fix Kodi notifications decoding. Fixes #6354
Browse files Browse the repository at this point in the history
  • Loading branch information
medariox committed Mar 15, 2019
1 parent 4e87320 commit 60b59ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions medusa/notifiers/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _notify_kodi(self, title, message, host=None, username=None, password=None,
}
notify_result = self._send_to_kodi(command, cur_host, username, password, dest_app)
if notify_result and notify_result.get('result'):
result += cur_host + ':' + notify_result['result'].decode('utf-8')
result += cur_host + ':' + notify_result['result']
else:
if app.KODI_ALWAYS_ON or force:
log.warning(
Expand Down Expand Up @@ -281,7 +281,7 @@ def clean_library(self):
# If no errors, return True. Otherwise keep sending command until all hosts are cleaned
return clean_library

def _update_library(self, host=None, series_name=None): # pylint: disable=too-many-return-statements, too-many-branches
def _update_library(self, host=None, series_name=None):
"""Handle updating KODI host via HTTP JSON-RPC.
Attempts to update the KODI video library for a specific tv show if passed,
Expand Down
3 changes: 2 additions & 1 deletion medusa/providers/torrent/html/bjshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def search(self, search_strings, age=0, ep_obj=None, **kwargs):

for search_string in search_strings[mode]:
if mode != 'RSS':
log.debug('Search string: {0}'.format(search_string.decode('utf-8')))
log.debug('Search string: {search}',
{'search': search_string})

# Remove season / episode from search (not supported by tracker)
search_str = re.sub(r'\d+$' if anime else r'[S|E]\d\d', '', search_string).strip()
Expand Down
4 changes: 2 additions & 2 deletions medusa/providers/torrent/json/torrentday.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ def search(self, search_strings, age=0, ep_obj=None, **kwargs):
params = dict({'q': search_string}, **self.categories[mode])

response = self.session.get(self.urls['search'], params=params)
if not response or not response.content:
if not response or not response.text:
log.debug('No data returned from provider')
continue

try:
jdata = djson.loads(response.content)
jdata = djson.loads(response.text)
except ValueError as error:
log.error("Couldn't deserialize JSON document. Error: {0!r}", error)
continue
Expand Down
2 changes: 1 addition & 1 deletion medusa/scene_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def _get_anidb_exceptions(force):

if anime and anime.name != show.name:
series_id = int(show.series_id)
exceptions[series_id] = [{anime.name.decode('utf-8'): -1}]
exceptions[series_id] = [{anime.name: -1}]

set_last_refresh('anidb')

Expand Down

0 comments on commit 60b59ea

Please sign in to comment.