diff --git a/pkg/service/bmx/tunein.go b/pkg/service/bmx/tunein.go index 5e41f3c7..234f1748 100644 --- a/pkg/service/bmx/tunein.go +++ b/pkg/service/bmx/tunein.go @@ -210,9 +210,10 @@ func tuneInSectionsAshx(tuneInURI string, subsection *int) ([]models.BmxNavSecti continue } + itemType, _ := m["type"].(string) + if children, ok := m["children"].([]interface{}); ok && len(children) > 0 { name, _ := m["text"].(string) - section := models.BmxNavSection{ Name: name, Items: make([]models.BmxNavItem, 0, len(children)), @@ -222,7 +223,6 @@ func tuneInSectionsAshx(tuneInURI string, subsection *int) ([]models.BmxNavSecti if !ok { continue } - childType, _ := cm["type"].(string) if childType == "audio" { section.Items = append(section.Items, tuneInNavigatePlayItem(cm)) @@ -230,10 +230,17 @@ func tuneInSectionsAshx(tuneInURI string, subsection *int) ([]models.BmxNavSecti section.Items = append(section.Items, tuneInNavigateLink(cm)) } } - sections = append(sections, section) - } else { + continue + } + + switch itemType { + case "link": topItems = append(topItems, tuneInNavigateLink(m)) + case "audio": + topItems = append(topItems, tuneInNavigatePlayItem(m)) + case "text": + // ignore } }