feat(deeplink): кнопка поиска в SOVA (re.sova.five, только sideload)
This commit is contained in:
@@ -15,7 +15,10 @@ enum class DeeplinkService(
|
||||
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");
|
||||
DEEZER("deezer", "Deezer", "https://www.deezer.com/search/%s"),
|
||||
// Сторонний клиент ВК (мод VK 6.12). Открываем поиск музыки напрямую в его
|
||||
// пакете через LinkRedirActivity. Доступен только в sideload-сборке.
|
||||
SOVA("sova", "SOVA", "https://vk.com/audio?q=%s", packageName = "re.sova.five");
|
||||
|
||||
fun buildSearchUrl(artist: String, song: String): String {
|
||||
val query = java.net.URLEncoder.encode("$artist $song", "UTF-8")
|
||||
|
||||
@@ -108,7 +108,11 @@ class PlayerViewModel @Inject constructor(
|
||||
}
|
||||
viewModelScope.launch {
|
||||
settingsRepository.getEnabledDeeplinkServices().collect { ids ->
|
||||
_enabledServices.value = DeeplinkService.entries.filter { it.serviceId in ids }
|
||||
_enabledServices.value = DeeplinkService.entries.filter {
|
||||
it.serviceId in ids &&
|
||||
// SOVA (сторонний мод ВК) — только в sideload-сборке.
|
||||
(com.radiola.BuildConfig.SHOW_DEV_TOOLS || it != DeeplinkService.SOVA)
|
||||
}
|
||||
}
|
||||
}
|
||||
viewModelScope.launch {
|
||||
|
||||
@@ -407,7 +407,11 @@ fun SettingsScreen(
|
||||
.background(colors.surface)
|
||||
.border(1.dp, colors.border, RoundedCornerShape(16.dp))
|
||||
) {
|
||||
DeeplinkService.entries.forEachIndexed { index, service ->
|
||||
// В store-сборке скрываем SOVA (сторонний мод ВК) — только sideload.
|
||||
val services = DeeplinkService.entries.filter {
|
||||
com.radiola.BuildConfig.SHOW_DEV_TOOLS || it != DeeplinkService.SOVA
|
||||
}
|
||||
services.forEachIndexed { index, service ->
|
||||
val checked = service.serviceId in enabledServices
|
||||
val trackColor by animateColorAsState(
|
||||
targetValue = if (checked) colors.accent else colors.surface2,
|
||||
@@ -438,7 +442,7 @@ fun SettingsScreen(
|
||||
)
|
||||
)
|
||||
}
|
||||
if (index < DeeplinkService.entries.size - 1) {
|
||||
if (index < services.size - 1) {
|
||||
HorizontalDivider(
|
||||
color = colors.border,
|
||||
modifier = Modifier.padding(horizontal = 16.dp)
|
||||
|
||||
Reference in New Issue
Block a user