Post

Replies

Boosts

Views

Activity

Reply to List of Genre IDs?
Hey, man. I have a short list of genre IDs in my open-source app here: https://github.com/adityasaravana/Tuneder/blob/main/Tuneder/GenreSelection.swift, if you want to borrow some of those, and here's a simple script I run when my app launches to collect some genre data. func search(_ query: String) async { /// This code fetches the genres and ids of songs that that you enter in searchTerm, useful for adding more genres (See GenreSelection) do { let songSearch = try await MCatalog.search(for: query, types: [.songs], limit: 3) for song in songSearch.songs { let songDetailed = try await MCatalog.song(id: song.id, fetch: [.genres]) for genre in songDetailed.genres! { print("⚠️⚠️⚠️⚠️⚠️⚠️ GENRE NAME: \(genre.name), ID: \(genre.id) ⚠️⚠️⚠️⚠️⚠️⚠️") } } } catch { print("caught at MusicManager.searchQuery") } } .onAppear { #if DEBUG /// Finding the IDs of genres to add to GenreSelection. Task { await musicManager.search("jazz") } #endif }
Topic: Media Technologies SubTopic: General Tags:
Jun ’23
Reply to Widgets not showing up on macOS
Having this same issue, anyone got a solution?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to List of Genre IDs?
UPDATE: You need to import MusadoraKit for the code above to work; https://github.com/rryam/MusadoraKit
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to List of Genre IDs?
Hey, man. I have a short list of genre IDs in my open-source app here: https://github.com/adityasaravana/Tuneder/blob/main/Tuneder/GenreSelection.swift, if you want to borrow some of those, and here's a simple script I run when my app launches to collect some genre data. func search(_ query: String) async { /// This code fetches the genres and ids of songs that that you enter in searchTerm, useful for adding more genres (See GenreSelection) do { let songSearch = try await MCatalog.search(for: query, types: [.songs], limit: 3) for song in songSearch.songs { let songDetailed = try await MCatalog.song(id: song.id, fetch: [.genres]) for genre in songDetailed.genres! { print("⚠️⚠️⚠️⚠️⚠️⚠️ GENRE NAME: \(genre.name), ID: \(genre.id) ⚠️⚠️⚠️⚠️⚠️⚠️") } } } catch { print("caught at MusicManager.searchQuery") } } .onAppear { #if DEBUG /// Finding the IDs of genres to add to GenreSelection. Task { await musicManager.search("jazz") } #endif }
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’23