chrisbenincasa / tunarr

Create a classic TV experience using your own media - IPTV backed by Plex/Jellyfin
https://tunarr.com/
zlib License
176 stars 14 forks source link

New device notifications from plex when reporting play status #960

Open jasonatepaint opened 1 week ago

jasonatepaint commented 1 week ago

If you turn on Send Play Status to Media Source, it causes Plex to send notifications that a user has added a new device for each stream. It looks like a new session id is created for each stream, which is being used as a client identifier. This new client id causes Plex to think it's a new client. This happens on channel changes or any stream change.

It also seems to keep these streams active in Plex. If you hover over them, most of them aren't actually streaming, but shows the video is beyond the end. (e.g. 24:21/21:38)

Version: 0.15.9
FFMPEG: 7.0
NodeJS: 20.18.0

Plex version 1.41.2.9134

chrisbenincasa commented 1 week ago

Thanks for the report! There's definitely some issues with this aspect of Tunarr. I'll take a look.

jasonatepaint commented 5 days ago

Just an update.... I fixed this issue locally by updating the following line in:
https://github.com/chrisbenincasa/tunarr/blob/ba8a19b65affd7b4ab3e6b749b588651124b6fa7/server/src/tasks/plex/UpdatePlexPlayStatusTask.ts#L118

TO: 'X-Plex-Client-Identifier': 'tunarr'

Keeping this to a single distinct value seems to make Plex and Tunarr play nicely when switching channels/etc. The plex status is still updated w/the channel number (via deviceName) but the Tunarr client appears as a single device.

This value should probably be concatenation of tunarr and a static UUID that is generated on install/first run (e.g. installation id).

I have not found any other side effects from this approach.

chrisbenincasa commented 5 days ago

Thanks! PRs welcome if you wish!