Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uncaught exception in Player.report_playback() #791

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jellyfin_kodi/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,13 @@
if not report:

previous = item['CurrentPosition']
item['CurrentPosition'] = int(self.getTime())

try:
item['CurrentPosition'] = int(self.getTime())
except Exception as e:

Check warning on line 332 in jellyfin_kodi/player.py

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/player.py#L330-L332

Added lines #L330 - L332 were not covered by tests
# getTime() raises RuntimeError if nothing is playing
LOG.debug("Failed to get playback position: %s", e)
return

Check warning on line 335 in jellyfin_kodi/player.py

View check run for this annotation

Codecov / codecov/patch

jellyfin_kodi/player.py#L334-L335

Added lines #L334 - L335 were not covered by tests

if int(item['CurrentPosition']) == 1:
return
Expand Down
Loading