mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 01:36:11 +00:00
Add retries and update playback report to emby
This commit is contained in:
parent
6644504005
commit
354a6669ac
2 changed files with 5 additions and 5 deletions
|
@ -43,7 +43,7 @@ class KodiMonitor(xbmc.Monitor):
|
|||
|
||||
def onScanFinished(self, library):
|
||||
|
||||
log.debug("Kodi library scan %s finished", library)
|
||||
log.info("Kodi library scan %s finished", library)
|
||||
if library == "video":
|
||||
window('emby_kodiScan', clear=True)
|
||||
|
||||
|
@ -74,6 +74,7 @@ class KodiMonitor(xbmc.Monitor):
|
|||
return
|
||||
|
||||
if method == 'Player.OnPlay':
|
||||
self.retry = True
|
||||
self._on_play_(data)
|
||||
|
||||
elif method == 'VideoLibrary.OnUpdate':
|
||||
|
|
|
@ -291,17 +291,16 @@ class Service(object):
|
|||
kodi_player = self.kodi_player
|
||||
try:
|
||||
play_time = kodi_player.getTime()
|
||||
filename = kodi_player.currentFile
|
||||
|
||||
filename = kodi_player.getPlayingFile()
|
||||
# Update positionticks
|
||||
if filename in kodi_player.played_info:
|
||||
if filename in kodi_player.played_info and play_time > 0:
|
||||
kodi_player.played_info[filename]['currentPosition'] = play_time
|
||||
|
||||
difference = datetime.today() - self.last_progress
|
||||
difference_seconds = difference.seconds
|
||||
|
||||
# Report progress to Emby server
|
||||
if difference_seconds > 3:
|
||||
if difference_seconds > 9:
|
||||
kodi_player.reportPlayback()
|
||||
self.last_progress = datetime.today()
|
||||
|
||||
|
|
Loading…
Reference in a new issue