zomboided 5 Posted August 8, 2017 Posted August 8, 2017 (edited) Hello, I'm writing a Kodi addon which limits the number of videos that'll be played in a playlist. I've a Kodi player class, which does something like this : class KodiPlayer(xbmc.Player): playback_count = 0 def __init__ (self): xbmc.Player.__init__(self) self.logger = None def onPlayBackStarted(self, *arg): if self.playback_count >= playlist_max_count: xbmc.Player().stop() def onPlayBackEnded(self, *arg): self.playback_count += 1 The call in onPlayBackStarted to stop playback works, but it has the effect of causing the Emby addon to crash, as below: 22:04:59.883 T:13092 NOTICE: EMBY.ga_client -> ERROR:: XBMC is not playing any videofile Traceback (most recent call last): File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\ga_client.py", line 24, in wrapper return func(*args, **kwargs) File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 76, in onNotification self._on_play_(data) File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 98, in _on_play_ item = xbmc.Player().getVideoInfoTag() RuntimeError: XBMC is not playing any videofile22:04:59.883 T:13092 NOTICE: EMBY.ga_client -> ERROR:: log_error: onNotification args: (<kodimonitor.KodiMonitor object at 0x12F1B300>, 'xbmc', 'Player.OnPlay', '{"item":{"id":3862,"type":"episode"},"player":{"playerid":1,"speed":1}}') kwargs: {}22:04:59.883 T:13092 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.RuntimeError'> Error Contents: XBMC is not playing any videofile Traceback (most recent call last): File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\ga_client.py", line 24, in wrapper return func(*args, **kwargs) File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 76, in onNotification self._on_play_(data) File "C:\Users\ADMIN\AppData\Roaming\Kodi\addons\plugin.video.emby\resources\lib\kodimonitor.py", line 98, in _on_play_ item = xbmc.Player().getVideoInfoTag() RuntimeError: XBMC is not playing any videofile -->End of Python script error report<--22:04:59.886 T:13092 ERROR: EXCEPTION: XBMC is not playing any file Anything I can do to avoid this? It happens everytime. I can post a full log if that helps. Edited August 8, 2017 by zomboided
zomboided 5 Posted August 8, 2017 Author Posted August 8, 2017 Thanks, attached the log. embycrash.log
Angelblue05 4132 Posted August 8, 2017 Posted August 8, 2017 I'm sorry, I should have said. Is it possible for you to enable emby for kodi log level set to info? Under add-on settings > advanced > log level info
Angelblue05 4132 Posted August 8, 2017 Posted August 8, 2017 @@zomboided Please download and install from zip in Kodi, the build here: https://emby.media/community/index.php?/topic/49757-plugin-fails-to-sync-with-server/?p=474639 Let me know if it helps any. 1
zomboided 5 Posted August 9, 2017 Author Posted August 9, 2017 Nope, still the same problem. Attached a new log. I can share my addon if that helps. You just tell it the maximum number of videos to play and then start a playlist. You can skip to right before the end of each video to make it recreate within 3 videos. embycrash3.kodi.log
Angelblue05 4132 Posted August 9, 2017 Posted August 9, 2017 bah, I guess my fix didn't take. Ok give me a few. Thank you.
Angelblue05 4132 Posted August 9, 2017 Posted August 9, 2017 @@zomboided plugin.video.emby-2.3.50a.zip
zomboided 5 Posted August 9, 2017 Author Posted August 9, 2017 Yep, exceptions are gone! Thanks for fixing so quickly. I still see this in the log, but if this is just a message and not a crash then no problem 11:12:28.772 T:6436 NOTICE: EMBY.kodimonitor -> Method: Player.OnPlay Data: {"item":{"id":3883,"type":"episode"},"player":{"playerid":1,"speed":1}}11:12:28.775 T:6436 NOTICE: EMBY.kodimonitor -> kodi_id: 3883 item_type: episode11:12:28.791 T:6436 NOTICE: EMBY.player -> Clear playlist properties.11:12:28.792 T:6436 ERROR: EXCEPTION: XBMC is not playing any file
Recommended Posts