Merged
Conversation
- **HTTP Server**:
- Switch Ktor engine from Netty to CIO and add a health check endpoint.
- Implement smarter IP selection with subnet matching to ensure the server is reachable by the Cast device.
- Add automatic port fallback if 8080 is occupied.
- Improve foreground service management and start/stop state handling.
- **Cast Integration**:
- Add a "priming" mechanism to start the HTTP server while the app is in the foreground, avoiding background service restrictions.
- Implement a preflight "wait for endpoint" check to ensure media is ready before sending the load command to the Cast device.
- Enhance error reporting with specific toast messages for connection failures and session issues.
- Add detailed error callback to `CastTransferStateHolder` to surface playback errors to the UI.
- **Data & Backup**:
- Migrate `TypeToken` usage to `TypeToken.getParameterized` across all backup modules to fix potential generic type erasure issues in release builds.
- Add ProGuard rules for Gson, Netty, Ktor, and Cast framework to prevent R8 from stripping reflective entry points or service-loaded classes.
- **PlayerViewModel**:
- Update `playSong` to use a derived `playbackContext`, ensuring consistency between local and remote playback queues.
- Switch from object equality to ID-based matching (`indexOfFirst { it.id == ... }`) when locating songs in lists and queues to prevent failures due to stale object references.
- Implement `effectiveStartSong` logic in `internalPlaySongs` to safely fallback to the first available song if the requested song is missing.
- Add safety check to `internalPlaySongs` to handle empty song lists.
- **Queue & Cast Management**:
- Update `QueueStateHolder` and `CastTransferStateHolder` to use ID-based index lookups when building shuffled queues or transferring playback to Cast devices.
- Ensure `validStartSong` selection in `playSongs` remains robust by validating against song IDs after filtering.
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.
No description provided.