Skip to content

Commit 8a0fc22

Browse files
authored
Fix radio browse with no args to show interactive picker (#25)
* Fix radio browse with no args to show interactive picker When 'kefw2 radio browse' is called without arguments, always show the interactive content picker instead of attempting to auto-play when only one 'playable' item is found (which could be a filter or pseudo-item). * Auto-play behavior is preserved when a specific path is provided.
1 parent 2ba4318 commit 8a0fc22

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.4] - 2026-02-04
11+
12+
### Fixed
13+
14+
- Improve station selection logic for radio playback
15+
- `radio browse` with no arguments now shows the interactive picker instead of attempting to auto
16+
1017
## [0.2.3] - 2025-02-04
1118

1219
### Fixed
@@ -366,7 +373,8 @@ Implemented by: `Source`, `SpeakerStatus`, `CableMode`
366373

367374
7. **Update player ID field access**: If you access `playId.SystemMemberId`, change it to `playId.SystemMemberID`.
368375

369-
[Unreleased]: https://github.com/hilli/go-kef-w2/compare/v0.2.3...HEAD
376+
[Unreleased]: https://github.com/hilli/go-kef-w2/compare/v0.2.4...HEAD
377+
[0.2.4]: https://github.com/hilli/go-kef-w2/compare/v0.2.3...v0.2.4
370378
[0.2.3]: https://github.com/hilli/go-kef-w2/compare/v0.2.2...v0.2.3
371379
[0.2.2]: https://github.com/hilli/go-kef-w2/compare/v0.2.1...v0.2.2
372380
[0.2.1]: https://github.com/hilli/go-kef-w2/compare/v0.2.0...v0.2.1

cmd/kefw2/cmd/radio.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,9 @@ an interactive fuzzy-filter picker.`,
731731
}
732732
}
733733

734-
// If there's exactly 1 playable item, play/save it directly (no picker)
735-
if len(playableItems) == 1 && !saveFavoriteFlag {
734+
// If there's exactly 1 playable item AND a path was specified, play/save it directly (no picker)
735+
// When browsePath is empty (no args), always show the interactive picker
736+
if len(playableItems) == 1 && !saveFavoriteFlag && browsePath != "" {
736737
station := &playableItems[0]
737738
headerPrinter.Printf("Playing: %s\n", station.Title)
738739
err := client.ResolveAndPlayRadioStation(station)
@@ -741,7 +742,7 @@ an interactive fuzzy-filter picker.`,
741742
return
742743
}
743744

744-
if len(playableItems) == 1 && saveFavoriteFlag {
745+
if len(playableItems) == 1 && saveFavoriteFlag && browsePath != "" {
745746
station := &playableItems[0]
746747
headerPrinter.Printf("Saving: %s\n", station.Title)
747748
err := client.AddRadioFavorite(station)

0 commit comments

Comments
 (0)