Skip to content

Conversation

@sususu98
Copy link
Contributor

I found that when I switch devices and play in a short time, Jellystat will merge my activities. I think the playback on different devices should not be merged, so I added a check for DeviceId before activity merging

@sususu98 sususu98 marked this pull request as ready for review March 11, 2025 09:20
@CyferShepard
Copy link
Owner

Hey @sususu98 , the reason it was removed at first was because when playing on certain clients. the device id was being refreshed on jellyfins side every second. resulting in a new playback every second. I do get where your coming from though as this is also not ideal. but we'll need to find a way to implement this without re-introducing the new activity per second bug.

@sususu98
Copy link
Contributor Author

What if I change it to check the Client?

 const sameDevice =  existing.Client === playbackData.Client;

@CyferShepard
Copy link
Owner

You could test it out and try. Im not sure what the naming scheme for clients are of the top of my head. Im worried there may be some clients sharing the same name. Eg using web but on different devices should use the same Client Name. eg Jellyfin Web or something similar. This then still results in merging under certain conditions. Some testing is needed to figure out an alternative besides device id

@sususu98
Copy link
Contributor Author

Hey @sususu98 , the reason it was removed at first was because when playing on certain clients. the device id was being refreshed on jellyfins side every second. resulting in a new playback every second. I do get where your coming from though as this is also not ideal. but we'll need to find a way to implement this without re-introducing the new activity per second bug.

the device id was being refreshed on jellyfins side every second.

What was the situation in which this occurred?

@sususu98
Copy link
Contributor Author

You could test it out and try. Im not sure what the naming scheme for clients are of the top of my head. Im worried there may be some clients sharing the same name. Eg using web but on different devices should use the same Client Name. eg Jellyfin Web or something similar. This then still results in merging under certain conditions. Some testing is needed to figure out an alternative besides device id

If the client uses the same client's name, say jellyfin web, and plays the same episodes, then merge them.If the user switches clients, then don't merge them. I think this logic is correct.
At least it is more reasonable than if the user has switched clients, but the active list also shows history client.

@CyferShepard
Copy link
Owner

This would work, not 100% accurate but atleast it narrows down the scope for merged and non merged activities

@sususu98
Copy link
Contributor Author

Mainly I found that transcoding may occur when I switch clients, but Jellystat does not record my transcoding information correctly.

@CyferShepard
Copy link
Owner

Mainly I found that transcoding may occur when I switch clients, but Jellystat does not record my transcoding information correctly.

When you say it doesnt record the transcoding information correctly. What behavior are you experiencing?

@sususu98
Copy link
Contributor Author

  1. Play a media (transcode)
  2. Stop it, and I can see in Jellystat
    image
  3. play the same media(direct), in Jellyfin I can see
    image
  4. Stop it, I can see in Jellystat
    image
    There is no record of the playback I just performed direct play. Can only still see the playback records of the recent transcoding playback

@CyferShepard
Copy link
Owner

Could you log that as a bug? il check out this weekend

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

Successfully merging this pull request may close these issues.

2 participants