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

View file

@ -326,7 +326,13 @@ class Player(xbmc.Player):
if not report: if not report:
previous = item['CurrentPosition'] previous = item['CurrentPosition']
item['CurrentPosition'] = int(self.getTime())
try:
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