From 1a1a30683173f64f69d0029d48f755bf7403672d Mon Sep 17 00:00:00 2001
From: angelblue05 <angelblue.dev@gmail.com>
Date: Thu, 1 Nov 2018 01:39:02 -0500
Subject: [PATCH] Fix nextup

---
 resources/lib/monitor.py | 6 +++---
 resources/lib/player.py  | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/resources/lib/monitor.py b/resources/lib/monitor.py
index 5c56a0a2..b742361e 100644
--- a/resources/lib/monitor.py
+++ b/resources/lib/monitor.py
@@ -46,8 +46,8 @@ class Monitor(xbmc.Monitor):
         LOG.info("--<[ kodi scan/%s ]", library)
 
     def onNotification(self, sender, method, data):
-    
-        if sender.lower() not in ('plugin.video.emby', 'xbmc', 'upnextprovider'):
+
+        if sender.lower() not in ('plugin.video.emby', 'xbmc', 'upnextprovider.signal'):
             return
 
         if sender == 'plugin.video.emby':
@@ -63,7 +63,7 @@ class Monitor(xbmc.Monitor):
 
             data = json.loads(data)[0]
 
-        elif sender == 'upnextprovider':
+        elif sender.startswith('upnextprovider'):
             method = method.split('.')[1]
 
             if method not in ('plugin.video.emby_play_action'):
diff --git a/resources/lib/player.py b/resources/lib/player.py
index 5df8af61..aa047634 100644
--- a/resources/lib/player.py
+++ b/resources/lib/player.py
@@ -228,7 +228,7 @@ class Player(xbmc.Player):
         item = self.played[current_file]
         objects = Objects()
 
-        if item['Type'] != 'Episode':
+        if item['Type'] != 'Episode' or not item.get('CurrentEpisode'):
             return
 
         next_items = item['Server']['api'].get_adjacent_episodes(item['CurrentEpisode']['tvshowid'], item['Id'])
@@ -262,7 +262,7 @@ class Player(xbmc.Player):
             'next_episode': data
         }
 
-        LOG.debug("--[ next up ] %s", json.dumps(next_info, indent=4))
+        LOG.info("--[ next up ] %s", next_info)
         event("upnext_data", next_info, hexlify=True)
 
     def onPlayBackPaused(self):