Skip to content

fix(music): show the endless radio switch as on while a started station plays - #1185

Merged
A-EDev merged 3 commits into
Flow-Tube:mainfrom
AmyJeanes:fix/music-radio-switch-station
Oct 12, 2026
Merged

A-EDev merged 3 commits into
Flow-Tube:mainfrom
AmyJeanes:fix/music-radio-switch-station

Conversation

@AmyJeanes

Copy link
Copy Markdown
Contributor

Summary

A station started with Start radio keeps playing even when endless radio is off, but the queue sheet's switch only showed the saved setting: it read off while the station ran, and turning it off didn't stop the station.

  • EnhancedMusicPlayerManager.kt: the explicit-station flag moves out of Media3MusicService into a session-only radioStationActive flow (reset with the queue), so the UI can see it. The service sets it on an explicit reseed and reads it when extending.
  • MusicRadioSwitch.kt (new, split out of MusicPlayerViewModel like MusicPlayerLyrics): the switch shows on for the saved setting or a running station, so one tap stops whichever is running; turning it off ends the station too.
  • EnhancedMusicPlayerManager.playTrack ends a named station. The service reads a new queue that shares a track with the station as the same session (MusicRadioPlanner.resolveQueueContext), so the station used to carry on, unseen, into the next queue the user played. Start radio still re-marks it from its pending seed.
  • Tests: MusicRadioSwitchTest (4) and MusicRadioStationTest (1).

Follows the desktop behaviour agreed in Flow-Tube/Flow-Desktop#93.

Related issue

None filed. Follow-up to Flow-Tube/Flow-Desktop#93, as mentioned there.

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Build, packaging, or CI
  • Documentation

Validation

  • ./gradlew :app:assembleGithubDebug
  • ./gradlew :app:testGithubDebugUnitTest (3141 tests, 0 failures)
  • I ran any additional flavor-specific build or test tasks affected by this change. (compileFossDebugKotlin, spotlessCheck, ktlintCheck)
  • I manually tested the affected behavior on an Android device or emulator.

Test device and Android version:

Pixel 10 Pro · Android 17 (SDK 37)

Endless radio off: Start radio shows the switch on and keeps refilling; one tap turns it off and nothing more is added. Starting a station, then playing a song that was already in it, ends the station. With the setting on, turning the switch off clears both.

Screenshots or recordings

start-radio-switch-android.mp4

Risk and compatibility

Session-only state; the saved setting and its migration are untouched. The only playback change is that starting a new queue ends a named station, matching desktop.

AI disclosure: This PR was largely written by Claude (Opus 5.5) but was fully reviewed and tested by myself before raising this.

  • The change does not introduce secrets, private data, or unexpected telemetry.
  • New user-facing text uses Android string resources. (no new text)
  • Dependency and lockfile changes are intentional and limited to this PR. (none)
  • Room schema changes include the required version bump and migration, or this PR does not change the Room schema.
  • Breaking changes and upgrade steps are clearly documented. (none)

…on plays

A station started with Start radio keeps extending with endless radio
off, but the queue sheet's switch showed only the saved setting: it read
off while the station ran, and turning it off did not stop the station.

- Move the explicit-station flag out of Media3MusicService into
  EnhancedMusicPlayerManager.radioStationActive (session only, reset with
  the queue) so the UI can observe it.
- MusicRadioSwitch: the switch shows the setting or a running station, and
  turning it off ends the station too.
- EnhancedMusicPlayerManager.playTrack ends a named station: the service
  reads a new queue that shares a track with the station as the same
  session, so the station used to carry on into the user's next queue.
  Start radio re-marks it from its pending seed.

Matches Flow-Desktop Flow-Tube#93.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XATQLbtRgFGN5N2bEVWx82
@AmyJeanes
AmyJeanes requested a review from A-EDev as a code owner September 30, 2026 21:12
@github-actions github-actions Bot added player Video and audio playback ui Compose UI, theming, or Material 3 surfaces labels Sep 30, 2026
@A-EDev
A-EDev merged commit 7dae605 into Flow-Tube:main Oct 12, 2026
6 checks passed
@AmyJeanes
AmyJeanes deleted the fix/music-radio-switch-station branch October 12, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

player Video and audio playback ui Compose UI, theming, or Material 3 surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants