Return full search results and real playback state - #4
Merged
Conversation
- search() now resolves after the timeout with the complete device list instead of returning as soon as the first device responds; the internal search callback carries a `complete` flag - Add DLNACast.getPlaybackState(): live GetTransportInfo query so remote pauses/stops are visible; getState() reports the last observed transport state instead of always PLAYING while connected - Progress interpolation only advances when the transport state is PLAYING (previously any media with a known duration counted as playing) - Isolate caches per device: switching devices clears all cached state, re-casting on the same device resets only the progress cache Co-Authored-By: Claude Sonnet 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.
Summary
DLNACast.search()now resolves after the timeout with the complete device list — previously it resolved as soon as the first device responded, so multi-device homes only ever saw one TVDLNACast.getPlaybackState()performs a liveGetTransportInfoquery, so a pause/stop triggered on the device (remote control) is now visible to the app;getState()reports the last observed transport state instead of always claimingPLAYINGwhile connectedPLAYING(was: any media with a known duration was treated as playing, so paused playback drifted forward)Test plan
./gradlew test lint assembleReleasegreen locallygetState()display handles all states already)getPlaybackState()returnsPAUSED— needs a real device