Merge pull request #791 from pdf/report_playback_exception

Fix uncaught exception in Player.report_playback()
This commit is contained in:
Odd Stråbø 2024-02-07 08:58:57 +01:00 committed by GitHub
commit 3a58d34018
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -326,7 +326,13 @@ class Player(xbmc.Player):
if not report: if not report:
previous = item['CurrentPosition'] previous = item['CurrentPosition']
try:
item['CurrentPosition'] = int(self.getTime()) item['CurrentPosition'] = int(self.getTime())
except Exception as e:
# getTime() raises RuntimeError if nothing is playing
LOG.debug("Failed to get playback position: %s", e)
return
if int(item['CurrentPosition']) == 1: if int(item['CurrentPosition']) == 1:
return return