package com.radiola.domain.model

enum class DeeplinkService(
    val serviceId: String,
    val displayName: String,
    val searchUrlTemplate: String
) {
    YANDEX("yandex", "Яндекс Музыка", "https://music.yandex.ru/search?text=%s"),
    VK("vk", "ВК Музыка", "https://vk.com/audio?q=%s"),
    BOOM("boom", "BOOM", "https://boom.ru/search?query=%s"),
    SPOTIFY("spotify", "Spotify", "https://open.spotify.com/search/%s"),
    APPLE_MUSIC("apple", "Apple Music", "https://music.apple.com/search?term=%s"),
    YOUTUBE_MUSIC("youtube", "YouTube Music", "https://music.youtube.com/search?q=%s"),
    TIDAL("tidal", "Tidal", "https://listen.tidal.com/search?q=%s"),
    DEEZER("deezer", "Deezer", "https://www.deezer.com/search/%s");

    fun buildSearchUrl(artist: String, song: String): String {
        val query = java.net.URLEncoder.encode("$artist $song", "UTF-8")
        return searchUrlTemplate.format(query)
    }
}
