package xyz.cottongin.radio247.data.importing

internal fun deriveNameFromUrl(url: String): String {
    val path = try {
        java.net.URI(url).path
    } catch (_: Exception) {
        url
    }
    val lastSegment = path.trimEnd('/').substringAfterLast('/')
    return lastSegment.ifEmpty { url }
}
