Draft
Conversation
When a SyncPlay group starts playback, each member independently selects a media source version. This causes group members to end up on different streams (different quality, provider, etc.). Cache the first member's resolved source per item so that subsequent members in the same SyncPlay session reuse it. Explicit user selections still take priority and update the group cache.
Add SyncPlayGroupFilter that intercepts SyncPlay create/join/leave
controller actions to maintain a userId→groupId mapping in
SyncPlayGroupTracker. The media source cache now uses
group-scoped keys (sp:{groupId}:{itemId}) so two different
SyncPlay groups watching the same item won't pollute each other's
source selection.
When a user explicitly selects a different media source version while in a SyncPlay group, send a PlayNow command with the new MediaSourceId to all other group members via ISessionManager. This ensures everyone switches to the same stream instead of only updating the cache (which only affects future requests). The propagation is fire-and-forget to avoid blocking the initiator's playback request. A loop-prevention check ensures we only propagate when the selected source actually differs from the previously cached one.
…lock Direct constructor injection of ISyncPlayManager and ISessionManager in MediaSourceManagerDecorator caused a circular dependency deadlock during service resolution, preventing Jellyfin from starting. Switch to Lazy<> wrappers (same pattern used for GelatoManager and SubtitleProvider) to break the cycle and defer resolution until first use.
…own ID - SyncPlay members now see ALL sources regardless of which user triggered the catalog sync, so the cached source ID can always be matched - Don't cache the item's own ID (sources[0]) — it's the default and caching it blocks version switching since SyncPlay commands never carry mediaSourceId - Seed from ALL group members' sessions when cache is empty (not just current user), filter out item's own ID from seeds - Only override mediaSourceId when cache holds a specific stream ID - Add virtual source guard (gelato:// / stremio://) with cache eviction - Add null-user safety for streaming endpoint calls - Upgrade SyncPlay diagnostic logging to Info level Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Downgrade diagnostic logging from Info to Debug (keep Info only for group create/join tracking in filter) - Extract itemIdStr to shared scope, remove duplicate computation - Expand one-liner try-catch to multi-line for consistency - Fix comment accuracy (per-user configs exist, not strictly server-wide) - Remove redundant "no override" / "NOT caching" log messages - Trim verbose log lines throughout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the inline SyncPlay source resolution and cache update logic out of GetPlaybackMediaSources into: - ResolveSyncPlaySource: determines override source ID from cache/sessions - UpdateSyncPlayCache: caches resolved source, propagates version switches - SyncPlaySourceState: record struct passing state between the two GetPlaybackMediaSources now reads as 4 lines instead of ~100 inline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The session seeding could pick up a MediaSourceId from a group member's session that was playing a different item, then try to use it as a source for the current item — which would never match and fall back to default. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SyncPlay users now check a shared (user-agnostic) item cache key alongside their per-user key. When one group member triggers SyncStreams for an item, other members joining the same item get an instant cache hit instead of re-fetching from AIOStreams. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SyncPlay only syncs ItemId + position, not MediaSourceId. When Gelato injects multiple sources (different encodes from Stremio addons), group members can end up on different versions causing desync.
Currently, SyncPlay always forces users onto the first source stream. This is problematic because:
This adds server-side source synchronization across SyncPlay groups.
What it does
Test scenarios