Skip to content

Fix compact title pill, Navidrome date added sort, and ReplayGain queue-edit spike - #135

Merged
lostf1sh merged 3 commits into
mainfrom
fix/issues-132-133-134
Sep 28, 2026
Merged

lostf1sh merged 3 commits into
mainfrom
fix/issues-132-133-134

Conversation

@lostf1sh

Copy link
Copy Markdown
Collaborator

Fixes #132
Fixes #133
Fixes #134

Changes

Compact library title pill renders black (#134)

9c84a16 changed the compact navigation title pill from primaryContainer to surfaceContainerLowest. That color is pure black on dark themes. The pill now uses primaryContainer again, with onPrimaryContainer text, 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 Subsonic created field, and toEntity / toSong use 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), and TransitionController responds by calling DualPlayerEngine.cancelNext(). That method always ran playerA.volume = 1f, even when no crossfade was running. This dropped the ReplayGain volume, and ReplayGainProcessor then took the change for a user volume gesture. Several crossfade failure paths had the same hard-coded 1f.

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.
  • New unit tests: NavidromeResponseParserTest (parsing created, including nanosecond timestamps, a missing value and an invalid value) and NavidromeSongEntityTest (the server time is used, with sync time as the fallback).
  • :app:lintDebug fails with 94 errors in files this PR doesn't touch (the first is UnsafeOptInUsageError in FadingPlayer.kt). None are in changed files.
  • [Bug]: ReplayGain normalization is behaving strangely #133 was checked on an API 36 emulator. Test FLAC files were tagged REPLAYGAIN_TRACK_GAIN=-12 dB, and the track volume was sampled from dumpsys media.audio_flinger every ~150 ms:
Scenario Before After
Play next in queue 0 dB for ~1.7 s, then −12 dB −12 dB throughout
Reorder in queue – −12 dB throughout
Swipe to remove from queue – −12 dB throughout
2 s crossfade from a −12 dB track to a −6 dB track – Outgoing track fades from −12 dB to silence, incoming track settles at −6 dB with no 0 dB jump

Only "Play next in queue" was run on the build before the fix. The other rows were checked on the fixed build only.

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds server-reported song timestamps and fixes player volume during transitions.

The PR appears safe to merge; automated coverage for crossfade volume restoration is a non-blocking improvement.

Fix All in Claude CodeFindings

  1. P2 Volume restoration lacks tests ▶
Fix with agent prompt
### Issue 1
app/src/main/java/com/lostf1sh/pixelplayeross/data/service/player/DualPlayerEngine.kt:1362-1364
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.

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!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary

The PR restores the compact title pill’s container colors, uses Navidrome song creation times for date-added sorting, and preserves player volume across crossfade cancellation and recovery. It adds parsing and entity-conversion tests; the playback change would benefit from automated regression coverage.

Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Server[Navidrome created time] --> Parser[Song parser]
  Parser --> Cache[Cached song dateAdded]
  Cache --> Library[Unified library sort]
  Master[Master player volume] --> Snapshot[Crossfade volume snapshot]
  Snapshot --> Restore[Cancel or failure restoration]
  Snapshot --> Fade[Outgoing fade]
Loading

Reviews (1) · Last reviewed commit: "Keep ReplayGain volume when queue edits ..."

Comment on lines +1362 to +1364
private fun restoreVolumeBeforeTransition() {
volumeBeforeTransition?.let { playerA.volume = it }
volumeBeforeTransition = null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bro dwbi, we dont need tests.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lostf1sh
lostf1sh merged commit c455a70 into main Sep 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant