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

Live TV: exception when using progressMode: bar #111

Open
plh1511 opened this issue Nov 28, 2024 · 0 comments
Open

Live TV: exception when using progressMode: bar #111

plh1511 opened this issue Nov 28, 2024 · 0 comments

Comments

@plh1511
Copy link

plh1511 commented Nov 28, 2024

Using v2.11.0 with Plex HTPC on Windows, I see this error when progressMode is set to bar and I watch live TV:

[27-11-2024 09:28:16 PM] [ERROR] [Server] An unexpected error occured in the Plex alert handler
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\discord-rich-presence-plex\core\plex.py", line 151, in tryHandleAlert
    self.handleAlert(alert)
  File "C:\Users\User\AppData\Local\discord-rich-presence-plex\core\plex.py", line 363, in handleAlert
    activity["timestamps"] = { "start": round(currentTimestamp - viewOffset), "end": round(currentTimestamp + (item.duration - viewOffset)) }
                                                                                                               ~~~~~~~~~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

Discord status disappears.

If I change progressMode to elapsed, Discord will continue to be updated, but with 0 elapsed time. This doesn't happen with other content, like movies/shows (not live TV).

As an ugly workaround to let me continue using progressMode bar, I edited core/plex.py line 363:

	case "bar":
		activity["timestamps"] = { "start": round(currentTimestamp - viewOffset), "end": round(currentTimestamp + ((item.duration or 0) - viewOffset)) }

This gives me a progress bar of 00:00 to 00:00, but at least Discord is still being updated with everything else (correctly).

@plh1511 plh1511 changed the title Live TV: exception when uploading to Imgur Live TV: exception when using progressMode: bar Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant