Queue mgmt, Podcast support, Favorites section.
This commit is contained in:
@@ -134,6 +134,21 @@ struct SearchView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// Podcasts
|
||||
if let podcasts = groupedResults[.podcast], !podcasts.isEmpty {
|
||||
Section {
|
||||
ForEach(podcasts) { item in
|
||||
NavigationLink(value: convertToPodcast(item)) {
|
||||
SearchResultRow(item: item)
|
||||
}
|
||||
}
|
||||
} header: {
|
||||
Label("Podcasts", systemImage: "mic.fill")
|
||||
.font(.headline)
|
||||
.foregroundStyle(.primary)
|
||||
}
|
||||
}
|
||||
|
||||
// Radios
|
||||
if let radios = groupedResults[.radio], !radios.isEmpty {
|
||||
Section {
|
||||
@@ -177,6 +192,15 @@ struct SearchView: View {
|
||||
)
|
||||
}
|
||||
|
||||
private func convertToPodcast(_ item: MAMediaItem) -> MAPodcast {
|
||||
return MAPodcast(
|
||||
uri: item.uri,
|
||||
name: item.name,
|
||||
publisher: item.artists?.first?.name,
|
||||
imageUrl: item.imageUrl
|
||||
)
|
||||
}
|
||||
|
||||
private func convertToArtist(_ item: MAMediaItem) -> MAArtist {
|
||||
print("🔄 Converting to artist: \(item.name) (URI: \(item.uri))")
|
||||
|
||||
@@ -326,6 +350,8 @@ struct SearchResultRow: View {
|
||||
case .artist: return "music.mic"
|
||||
case .playlist: return "music.note.list"
|
||||
case .radio: return "antenna.radiowaves.left.and.right"
|
||||
case .podcast: return "mic.fill"
|
||||
case .podcastEpisode: return "mic"
|
||||
default: return "questionmark"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user