package xyz.cottongin.radio247.audio

object MetadataFormatter {
    fun formatTrackInfo(metadata: IcyMetadata?, fallback: String = "\u266A"): String {
        if (metadata == null) return fallback
        return when {
            metadata.artist != null && metadata.title != null ->
                "${metadata.artist} \u2014 ${metadata.title}"
            metadata.title != null -> metadata.title
            metadata.artist != null -> metadata.artist
            else -> fallback
        }
    }
}
