func addItemsToQueue<T>(
items: MusicItemCollection<T>,
at position: ApplicationMusicPlayer.Queue.EntryInsertionPosition
) async
where T: PlayableMusicItem {
do {
if player.queue.entries.isEmpty {
player.queue = .init(for: items)
} else {
try await player.queue.insert(items, position: position)
}
} catch {
await logger?.error(
"Unable to add songs to player queue: \(error.localizedDescription)"
)
return
}
do {
if !player.isPreparedToPlay {
await logger?.trace("Preparing player...")
try await player.prepareToPlay()
}
} catch {
await logger?.critical("Unable to prepare player: \(error.localizedDescription)")
}
}
This is a snippet which produces this error.
For some insane reason it only works on release
builds.
I am completely frustrated and there is no way to check what is going wrong inside the MusicKit library