Include radio stations in Quick Search
This commit is contained in:
@@ -99,8 +99,7 @@ func (a *RadiosPage) load(searchOnLoad bool, scrollPos float32) {
|
||||
}
|
||||
|
||||
func (a *RadiosPage) onPlay(station *mediaprovider.RadioStation) {
|
||||
a.pm.LoadRadioStation(station, backend.Replace)
|
||||
a.pm.PlayFromBeginning()
|
||||
a.pm.PlayRadioStation(station)
|
||||
}
|
||||
|
||||
func (a *RadiosPage) onQueue(station *mediaprovider.RadioStation, next bool) {
|
||||
|
||||
@@ -591,6 +591,12 @@ func (c *Controller) ShowQuickSearch() {
|
||||
c.NavigateTo(PlaylistRoute(id))
|
||||
case mediaprovider.ContentTypeGenre:
|
||||
c.NavigateTo(GenreRoute(id))
|
||||
case mediaprovider.ContentTypeRadioStation:
|
||||
if rp, ok := c.App.ServerManager.Server.(mediaprovider.RadioProvider); ok {
|
||||
if radio, err := rp.GetRadioStation(id); err == nil {
|
||||
go c.App.PlaybackManager.PlayRadioStation(radio)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
c.ClosePopUpOnEscape(pop)
|
||||
|
||||
@@ -212,6 +212,8 @@ func placeholderIconForContentType(c mediaprovider.ContentType) fyne.Resource {
|
||||
return myTheme.GenreIcon
|
||||
case mediaprovider.ContentTypePlaylist:
|
||||
return myTheme.PlaylistIcon
|
||||
case mediaprovider.ContentTypeRadioStation:
|
||||
return myTheme.RadioIcon
|
||||
default:
|
||||
return theme.WarningIcon() // unreached
|
||||
}
|
||||
@@ -284,6 +286,8 @@ func (s *searchResult) Update(result *mediaprovider.SearchResult) {
|
||||
secondaryText = result.ArtistName
|
||||
case mediaprovider.ContentTypePlaylist:
|
||||
secondaryText = fmt.Sprintf("%d %s", result.Size, maybePluralize("track", result.Size))
|
||||
case mediaprovider.ContentTypeRadioStation:
|
||||
fallthrough // result.Size is always 0 for radios
|
||||
case mediaprovider.ContentTypeGenre:
|
||||
if result.Size > 0 {
|
||||
secondaryText = fmt.Sprintf("%d %s", result.Size, maybePluralize("album", result.Size))
|
||||
|
||||
Reference in New Issue
Block a user