fix(android): notification art uses album cover, not embedded stream tags #84
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Same-day re-cut on the per-day mutable CalVer scheme (post-v2026.06.04 papercut).
Notification / lock-screen art now matches the in-app album cover
On-device observation: the MediaController notification and lock-screen background showed a different album cover than the in-app surfaces for some tracks.
Root cause — two different art sources:
TrackRef.coverUrl→/api/albums/{id}/cover(server album-level art).MediaMetadata.artworkData), becausePlayerController.toMediaItemnever setartworkUri. Media3'sBitmapLoader.loadBitmapFromMetadataprefersartworkDataoverartworkUri, and ExoPlayer extracts embedded picture frames into the live metadata. For tracks whose embedded tag art differs from the server album cover (compilations, re-grouped singles), the two surfaces disagreed.Fix (3 files):
PlayerController.toMediaItem— setartworkUritocoverUrl. Verified against Media3 1.10.1 source:MediaMetadata.Builder.populate()overwritesartworkUri+artworkDataas an atomic pair, andExoPlayerImpl.buildUpdatedMediaMetadatalayers MediaItem metadata over stream metadata — so the MediaItem URI clears the embeddedartworkData. Album cover wins on both surfaces.PlayerFactory.buildBitmapLoader— OkHttp-backedCacheBitmapLoader(DataSourceBitmapLoader(...))so the authedplaceholder.invalidcover URL resolves (Media3's defaultDefaultHttpDataSourceloader can't rewrite the host or attach the auth cookie).CacheBitmapLoaderdedupes refetches across metadata refreshes.MinstrelPlayerService— attach viaMediaSession.Builder.setBitmapLoader.Net: notification, lock screen, BT/AVRCP, Auto, Pixel Watch all show the same album cover as the app regardless of file tags.
Verify on device
🤖 Generated with Claude Code
The MediaController notification / lock-screen background pulled artwork from the stream's embedded ID3/FLAC tags (artworkData) because the MediaItem never set artworkUri — a different source than the in-app album cover (/api/albums/{id}/cover). For tracks whose embedded tag art differs from the server album cover, the two surfaces disagreed. - PlayerController.toMediaItem: set artworkUri to TrackRef.coverUrl. MediaMetadata.populate() overwrites artworkUri+artworkData as a pair, so the MediaItem URI clears the embedded bytes ExoPlayer extracts from the stream — the album cover now wins on both surfaces. - PlayerFactory.buildBitmapLoader: OkHttp-backed CacheBitmapLoader so the authed placeholder cover URL resolves (the default DefaultHttpDataSource loader can't rewrite placeholder.invalid or attach the auth cookie). - MinstrelPlayerService: attach it via MediaSession.setBitmapLoader. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>