This commit is contained in:
Will
2026-08-29 17:46:52 +02:00
committed by Tobias Gesellchen
parent 1c7f32e736
commit 255023702e
+11 -4
View File
@@ -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
}
}