mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Add a retry to detect playback
This commit is contained in:
parent
a4e12da8fe
commit
2a67cb2da5
1 changed files with 6 additions and 0 deletions
|
@ -25,6 +25,7 @@ KODI = int(xbmc.getInfoLabel('System.BuildVersion')[:2])
|
|||
|
||||
class KodiMonitor(xbmc.Monitor):
|
||||
|
||||
retry = True
|
||||
|
||||
def __init__(self):
|
||||
|
||||
|
@ -108,6 +109,11 @@ class KodiMonitor(xbmc.Monitor):
|
|||
|
||||
except (KeyError, TypeError):
|
||||
log.info("Item is invalid for playstate update")
|
||||
# Retry once, sometimes xbmc.Player().isPlayingVideo() will return false when played from widget.
|
||||
if self.retry:
|
||||
self.retry = False
|
||||
xbmc.sleep(200)
|
||||
return self._on_play_(data)
|
||||
else:
|
||||
if ((settings('useDirectPaths') == "1" and not item_type == "song") or
|
||||
(item_type == "song" and settings('enableMusic') == "true")):
|
||||
|
|
Loading…
Reference in a new issue