feat: auth screen with auto-redirect, sync favorites/history with backend

This commit is contained in:
nk
2026-06-02 19:12:07 +03:00
parent d4adb1e7be
commit a83672b455
2934 changed files with 97351 additions and 163 deletions

View File

@@ -3,14 +3,23 @@ package com.radiola.deeplink
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.util.Log
import android.widget.Toast
import com.radiola.domain.model.DeeplinkService
import com.radiola.domain.model.Track
object DeeplinkNavigator {
fun openSearch(context: Context, track: Track, service: DeeplinkService) {
Log.d("DeeplinkNavigator", "openSearch: artist=${track.artist}, song=${track.song}, service=${service.displayName}")
val url = service.buildSearchUrl(track.artist, track.song)
Log.d("DeeplinkNavigator", "url=$url")
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
context.startActivity(Intent.createChooser(intent, "Открыть в..."))
try {
context.startActivity(Intent.createChooser(intent, "Открыть в..."))
} catch (e: Exception) {
Log.e("DeeplinkNavigator", "Failed to open deeplink", e)
Toast.makeText(context, "Не удалось открыть ссылку", Toast.LENGTH_SHORT).show()
}
}
}