Fix compact title pill, Navidrome date added sort, and ReplayGain queue-edit spike - #135
Conversation
|
| private fun restoreVolumeBeforeTransition() { | ||
| volumeBeforeTransition?.let { playerA.volume = it } | ||
| volumeBeforeTransition = null |
There was a problem hiding this comment.
Volume restoration lacks tests The new saved-volume logic has no automated test for cancelling before or during a crossfade, or for restoring volume after a failure or player rebuild. A test starting at a ReplayGain-adjusted volume would help catch a return of the queue-edit volume jump or restoration to the wrong level.
Knowledge Base Used: Audio processing and equalizer
Prompt To Fix With AI
This is a comment left during a code review.
Path: app/src/main/java/com/lostf1sh/pixelplayeross/data/service/player/DualPlayerEngine.kt
Line: 1362-1364
Comment:
**Volume restoration lacks tests** The new saved-volume logic has no automated test for cancelling before or during a crossfade, or for restoring volume after a failure or player rebuild. A test starting at a ReplayGain-adjusted volume would help catch a return of the queue-edit volume jump or restoration to the wrong level.
**Knowledge Base Used:** [Audio processing and equalizer](https://app.greptile.com/moli/-/custom-context/knowledge-base/pixelplayerhq/pixelplayeross/-/docs/audio-processing-and-equalizer.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
bro dwbi, we dont need tests.
There was a problem hiding this comment.
Understood — given the emulator coverage and scope of this fix, I’ll treat the missing automated crossfade-cancellation tests as acceptable here. No further action needed.
Fixes #132
Fixes #133
Fixes #134
Changes
Compact library title pill renders black (#134)
9c84a16changed the compact navigation title pill fromprimaryContainertosurfaceContainerLowest. That color is pure black on dark themes. The pill now usesprimaryContaineragain, withonPrimaryContainertext, so it matches the bookmark and settings buttons next to it.Navidrome "Date Added" sort order is random (#132)
Each Navidrome song got
dateAdded = System.currentTimeMillis()when it was cached during sync. Songs from the same sync therefore shared nearly identical timestamps. The parser now reads the Subsoniccreatedfield, andtoEntity/toSonguse it. If the server doesn't send it, they fall back to the sync time. The schema is unchanged. Each sync rewrites the cached rows, so existing libraries correct themselves on their next sync.ReplayGain volume jumps after queue edits (#133)
Queue edits fire
onTimelineChanged(PLAYLIST_CHANGED), andTransitionControllerresponds by callingDualPlayerEngine.cancelNext(). That method always ranplayerA.volume = 1f, even when no crossfade was running. This dropped the ReplayGain volume, andReplayGainProcessorthen took the change for a user volume gesture. Several crossfade failure paths had the same hard-coded1f.The engine now saves the master volume when a crossfade starts (
volumeBeforeTransition) and restores that value when a crossfade is cancelled or fails. If no crossfade ran, the volume is left alone. The fade-out and player rebuild also start from the saved volume.Testing
./gradlew :app:compileDebugKotlin :app:testDebugUnitTest: pass.NavidromeResponseParserTest(parsingcreated, including nanosecond timestamps, a missing value and an invalid value) andNavidromeSongEntityTest(the server time is used, with sync time as the fallback).:app:lintDebugfails with 94 errors in files this PR doesn't touch (the first isUnsafeOptInUsageErrorinFadingPlayer.kt). None are in changed files.REPLAYGAIN_TRACK_GAIN=-12 dB, and the track volume was sampled fromdumpsys media.audio_flingerevery ~150 ms:Only "Play next in queue" was run on the build before the fix. The other rows were checked on the fixed build only.