Merge pull request #732 from croneter/fix-typeerror

Fix rare TypeError: unsupported operand type(s) for /: 'NoneType' and 'int' on playback startup
This commit is contained in:
croneter 2019-02-16 19:05:50 +01:00 committed by GitHub
commit 78def504bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -414,7 +414,7 @@ def _conclude_playback(playqueue, pos):
if v.KODIVERSION >= 18 and api: if v.KODIVERSION >= 18 and api:
# Kodi 18 Alpha 3 broke StartOffset # Kodi 18 Alpha 3 broke StartOffset
try: try:
percent = item.offset / api.runtime() * 100.0 percent = (item.offset or api.resume_point()) / api.runtime() * 100.0
except ZeroDivisionError: except ZeroDivisionError:
percent = 0.0 percent = 0.0
LOG.debug('Resuming at %s percent', percent) LOG.debug('Resuming at %s percent', percent)