Skip to content

Native Android client for Spotify, built with Jetpack Compose

Settings for the release: both looks have the same rows (Canvas in Immersive, a Lyrics group with romanization and a translation language picker, the full AutoMix explanation); AutoMix gets a transition style (beat blend, cut on the beat, smooth fade), lengths up to 32 bars, harmonic mixing, podcasts left unmixed unless asked, analysis on mobile data when allowed, the app's own savers followed, a reason when the next song will not mix (settings and Stats for nerds), a one-time explanation, its analyses' size and Clear, and Spotify streams fade 3 s instead of a leftover crossfade; a Storage page (media cache size, clear caches, downloads); Material You colours and the phone's font as options; lyrics kept with downloads for offline; SponsorBlock for podcasts (off by default, Spotify episodes known to SponsorBlock, sponsor reads skipped once with Undo)

kota-zo584f3d0855dd
diff --git a/base/app/src/main/java/com/music/spotui/App.kt b/base/app/src/main/java/com/music/spotui/App.kt
index 80abaae7..16131e0c 100644
--- a/base/app/src/main/java/com/music/spotui/App.kt
+++ b/base/app/src/main/java/com/music/spotui/App.kt
@@ -146,6 +146,8 @@ fun App() {
else com.music.spotui.ui.navigation.PlayerOverlay(navController)
// "Not interested" and its Undo, over the pages and the players.
com.music.spotui.ui.components.HiddenSongUndo()
+ // A sponsor read skipped in a podcast (SponsorBlock), and its Undo.
+ com.music.spotui.podcast.SponsorSkipUndo()
}
}
}
diff --git a/base/app/src/main/java/com/music/spotui/automix/AutoMix.kt b/base/app/src/main/java/com/music/spotui/automix/AutoMix.kt
index 0c043e8a..36aed3fb 100644
--- a/base/app/src/main/java/com/music/spotui/automix/AutoMix.kt
+++ b/base/app/src/main/java/com/music/spotui/automix/AutoMix.kt
@@ -34,6 +34,8 @@ object AutoMix {
fun set(value: Boolean) {
on = value
Graph.app.getSharedPreferences(PREFS, 0).edit().putBoolean(KEY, value).apply()
+ // The Spotify songs' fade follows: a short one with AutoMix on (see TransitionPref).
+ com.music.spotui.data.preferences.applyCrossfade(com.music.spotui.data.preferences.CrossfadePref.seconds)
journal("AutoMix ${if (value) "on" else "off"}")
}
@@ -70,8 +72,89 @@ object AutoMix {
private set
fun changePulseLevel(value: Int) { pulseLevel = value; Graph.app.getSharedPreferences(PREFS, 0).edit().putInt("automix_pulse", value).apply() }
- /** The planner's settings from the ones above. */
- fun settings() = MixPlanner.Settings(maxStretch = doubleArrayOf(0.04, 0.08, 0.12)[tempoRange], lengthBias = mixLength - 1)
+ /**
+ * The transition style: 0 beat blend (beat-matched where both grids allow, else a cut on the beat
+ * or a fade), 1 always a cut on A's downbeat (a fade when A has no grid), 2 always a plain fade.
+ */
+ var style by mutableStateOf(Graph.app.getSharedPreferences(PREFS, 0).getInt("automix_style", 0).coerceIn(0, 2))
+ private set
+ fun changeStyle(value: Int) { style = value; Graph.app.getSharedPreferences(PREFS, 0).edit().putInt("automix_style", value).apply(); com.music.spotui.di.LocalPlayer.autoMixSettingsChanged() }
+
+ /** Harmonic mixing: the songs' keys weigh strongly in the choice of the mix; off, they are ignored. On by default. */
+ var harmonic by mutableStateOf(Graph.app.getSharedPreferences(PREFS, 0).getBoolean("automix_harmonic", true))
+ private set
+ fun changeHarmonic(value: Boolean) { harmonic = value; Graph.app.getSharedPreferences(PREFS, 0).edit().putBoolean("automix_harmonic", value).apply(); com.music.spotui.di.LocalPlayer.autoMixSettingsChanged() }
+
+ /** Podcast episodes and audiobooks mixed like songs; off (the default), they start and end whole. */
+ var mixPodcasts by mutableStateOf(Graph.app.getSharedPreferences(PREFS, 0).getBoolean("automix_podcasts", false))
+ private set
+ fun changeMixPodcasts(value: Boolean) { mixPodcasts = value; Graph.app.getSharedPreferences(PREFS, 0).edit().putBoolean("automix_podcasts", value).apply(); com.music.spotui.di.LocalPlayer.autoMixSettingsChanged() }
+
+ /** Extension streams analysed on mobile data too (each is read a second time: about the song's size again). Off by default. */
+ var analyzeOnMobileData by mutableStateOf(Graph.app.getSharedPreferences(PREFS, 0).getBoolean("automix_mobile_data", false))
+ private set
+ fun changeAnalyzeOnMobileData(value: Boolean) {
+ analyzeOnMobileData = value
+ Graph.app.getSharedPreferences(PREFS, 0).edit().putBoolean("automix_mobile_data", value).apply()
+ // The songs refused on mobile data are asked again.
+ if (value) synchronized(memory) { refused.values.removeAll { it == Reason.MobileData } }
+ com.music.spotui.di.LocalPlayer.autoMixSettingsChanged()
+ }
+
+ /**
+ * The planner's settings from the ones above. Mix length in bars: short 4–8, balanced 2–16 (as
+ * the music says), long 12–32 (up to a minute); the lower end is a preference (a shorter mix only
+ * when no longer one fits the songs), the upper one a limit. A plain fade lasts 4, 8 or 14 s.
+ */
+ fun settings() = MixPlanner.Settings(
+ maxStretch = doubleArrayOf(0.04, 0.08, 0.12)[tempoRange],
+ maxSec = if (mixLength == 2) 64.0 else 32.0,
+ lengthBias = mixLength - 1,
+ style = arrayOf(MixPlan.Style.BLEND, MixPlan.Style.CUT, MixPlan.Style.FADE)[style],
+ minBars = intArrayOf(4, 2, 12)[mixLength],
+ maxBars = intArrayOf(8, 16, 32)[mixLength],
+ keyWeight = if (harmonic) 2.0 else 0.0,
+ smoothSec = doubleArrayOf(4.0, 8.0, 14.0)[mixLength],
+ )
+
+ // ── Why a song is not mixed (for the screens) ──
+
+ /** Why the next transition is not an AutoMix one. */
+ enum class Reason {
+ /** AutoMix is off. */
+ Off,
+ /** A Spotify song: it plays in the Web Player, whose audio the app never has. */
+ SpotifyStream,
+ /** The songs play on a Cast device. */
+ Cast,
+ /** A podcast episode or an audiobook, with "Mix podcasts" off. */
+ Podcast,
+ /** Two songs that follow each other on their album, with "Keep albums whole" on. */
+ Album,
+ /** A stream not analysed on mobile data ("Analyze on mobile data" off, or the data saver). */
+ MobileData,
+ /** Not analysed in time while saving energy (the phone's saver, the app's, or a low battery). */
+ Frugal,
+ /** Not analysed in time, or the analysis failed: the songs change with a plain fade. */
+ NotAnalyzed,
+ }
+
+ /** The reason LocalPlayer found for the next pair (null: it is mixed, or still being analysed). */
+ internal val pairReason = mutableStateOf<Reason?>(null)
+
+ /**
+ * Why the song playing does not mix into the next one, null when it does (or will, once
+ * analysed). Compose state: a screen reading it redraws when it changes.
+ */
+ fun whyNot(): Reason? = when {
+ !on -> Reason.Off
+ com.music.spotui.cast.CastPlayback.device.value != null || com.music.spotui.cast.CastPlayback.active -> Reason.Cast
+ !com.music.spotui.di.LocalPlayer.active.value -> Reason.SpotifyStream
+ else -> pairReason.value
+ }
+
+ /** Why [uri] has no analysis and will get none for now (null: ready, or under way). */
+ fun missing(uri: Uri): Reason? = synchronized(memory) { refused[key(uri)] }
fun changeShowInPlayer(value: Boolean) { showInPlayer = value; Graph.app.getSharedPreferences(PREFS, 0).edit().putBoolean("automix_show", value).apply() }
@@ -92,6 +175,8 @@ object AutoMix {
}
private val asked = HashSet<String>()
private val failed = HashSet<String>()
+ /** Songs without an analysis for now, and why (shown through [missing]). */
+ private val refused = HashMap<String, Reason>()
@Volatile private var wanted: Set<String> = emptySet()
/** The analysis of [uri] if it is ready (memory or cache), else null. */
@@ -106,7 +191,7 @@ object AutoMix {
* any other song; [ready] runs on the worker when one is done.
*/
fun request(uris: List<Uri>, ready: () -> Unit) {
- // Saving battery (the phone's saver, or under 20 % unplugged): the song playing and the next only.
+ // Saving energy (see [frugal]): the song playing and the next only.
val songs = if (frugal()) uris.take(2) else uris
wanted = songs.map(::key).toSet()
for (uri in songs) {
@@ -116,19 +201,24 @@ object AutoMix {
try {
if (key !in wanted) return@execute
val a = load(key) ?: analyse(uri, key)
- if (a != null) { synchronized(memory) { memory[key] = a }; ready() }
+ if (a != null) { synchronized(memory) { memory[key] = a; refused -= key }; ready() }
} finally { synchronized(memory) { asked -= key } }
}
}
}
private fun analyse(uri: Uri, key: String): TrackAnalysis? {
- // A stream is read a second time for the analysis: on unmetered networks only.
+ // A stream is read a second time for the analysis: on unmetered networks only, unless the
+ // listener allows mobile data (never under the data saver, which refuses every connection).
if (uri.scheme == ExtensionAudio.SCHEME) {
- if (com.music.spotui.data.DataSaver.metered) { journal("not analysed (metered network): ${uri.lastPathSegment}"); return null }
+ val saver = com.music.spotui.data.DataSaver.active
+ if (com.music.spotui.data.DataSaver.metered && (saver || !analyzeOnMobileData)) {
+ synchronized(memory) { refused[key] = Reason.MobileData }
+ journal("not analysed (${if (saver) "data saver" else "metered network"}): ${uri.lastPathSegment}"); return null
+ }
// DASH answers too: the data source reads them as one file, as the player does.
val s = runCatching { ExtensionAudio.resolve(uri, ahead = true) }.getOrNull()
- if (s == null) { synchronized(memory) { failed += key }; journal("not analysed (no stream): ${uri.lastPathSegment}"); return null }
+ if (s == null) { synchronized(memory) { failed += key; refused[key] = Reason.NotAnalyzed }; journal("not analysed (no stream): ${uri.lastPathSegment}"); return null }
}
val t0 = System.currentTimeMillis()
return try {
@@ -144,7 +234,7 @@ object AutoMix {
} catch (e: InterruptedException) {
null
} catch (e: Throwable) {
- synchronized(memory) { failed += key }
+ synchronized(memory) { failed += key; refused[key] = Reason.NotAnalyzed }
journal("analysis failed for ${label(uri)}: ${e.javaClass.simpleName} ${e.message?.take(120)}")
null
}
@@ -153,8 +243,11 @@ object AutoMix {
private fun charging(): Boolean =
runCatching { Graph.app.getSystemService(android.os.BatteryManager::class.java).isCharging }.getOrDefault(false)
- /** The phone saving battery: its saver on, or under 20 % and unplugged. */
- private fun frugal(): Boolean = runCatching {
+ /**
+ * Saving energy: the app's own energy saver or its data saver applying, the phone's battery
+ * saver, or under 20 % and unplugged.
+ */
+ internal fun frugal(): Boolean = app.myspoti.power.EnergySettings.state.value.manualSaver || com.music.spotui.data.DataSaver.active || runCatching {
val power = Graph.app.getSystemService(android.os.PowerManager::class.java)
val battery = Graph.app.getSystemService(android.os.BatteryManager::class.java)
power.isPowerSaveMode || (!battery.isCharging && battery.getIntProperty(android.os.BatteryManager.BATTERY_PROPERTY_CAPACITY) in 0 until 20)
@@ -206,8 +299,12 @@ object AutoMix {
private fun label(uri: Uri) = uri.lastPathSegment?.takeLast(48).orEmpty()
+ /** Off the main thread: every song analysed is dropped (they are analysed again when played). */
fun clearCache() {
- synchronized(memory) { memory.clear(); failed.clear() }
+ synchronized(memory) { memory.clear(); failed.clear(); refused.clear() }
dir().listFiles()?.forEach { it.delete() }
}
+
+ /** The space the analyses take on disk, in bytes (off the main thread). */
+ fun cacheBytes(): Long = dir().listFiles()?.sumOf { it.length() } ?: 0L
}
diff --git a/base/app/src/main/java/com/music/spotui/data/AppStorage.kt b/base/app/src/main/java/com/music/spotui/data/AppStorage.kt
new file mode 100644
index 00000000..69d48387
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/data/AppStorage.kt
@@ -0,0 +1,72 @@
+package com.music.spotui.data
+
+import android.content.Context
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import com.music.spotui.di.Graph
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.withContext
+import java.io.File
+
+/**
+ * Settings > Storage: what the app keeps in its cache folder, shown and emptied there. The media
+ * cache (Canvas videos, [com.music.spotui.di.SongPlayer.mediaCache]), the AutoMix analyses and
+ * Glide's covers; downloads are counted apart ([com.music.spotui.data.offline.OfflineStore]) and
+ * never cleared from here.
+ */
+object AppStorage {
+ private const val PREFS = "myspoti_prefs"
+ private const val KEY_MEDIA_MB = "media_cache_mb"
+ private const val MEDIA_DEFAULT_MB = 64
+
+ /** The sizes offered for the media cache, in MB (64 MB, the old fixed size, by default). */
+ val MEDIA_CACHE_CHOICES = listOf(64, 256, 512, 1024)
+
+ /** The media cache's size as chosen, in MB (Compose state). */
+ var mediaCacheMb by mutableStateOf(
+ Graph.app.getSharedPreferences(PREFS, 0).getInt(KEY_MEDIA_MB, MEDIA_DEFAULT_MB).takeIf { it in MEDIA_CACHE_CHOICES } ?: MEDIA_DEFAULT_MB)
+ private set
+
+ /** The size the open cache was given (null before its first use): the cache is sized once, so a change applies at the next start. */
+ var mediaCacheMbOpen by mutableStateOf<Int?>(null)
+ private set
+
+ fun chooseMediaCacheMb(mb: Int) {
+ mediaCacheMb = mb
+ Graph.app.getSharedPreferences(PREFS, 0).edit().putInt(KEY_MEDIA_MB, mb).apply()
+ }
+
+ /** The media cache's limit in bytes, read once when the cache is opened. */
+ fun mediaCacheLimit(): Long = mediaCacheMb.also { mediaCacheMbOpen = it } * 1024L * 1024
+
+ /** What each part takes, in bytes. */
+ class Usage(val media: Long, val automix: Long, val images: Long) {
+ val caches get() = media + automix + images
+ }
+
+ suspend fun usage(context: Context): Usage = withContext(Dispatchers.IO) {
+ Usage(
+ media = size(File(context.cacheDir, "media")),
+ automix = runCatching { com.music.spotui.automix.AutoMix.cacheBytes() }.getOrDefault(0L),
+ images = size(File(context.cacheDir, com.bumptech.glide.load.engine.cache.DiskCache.Factory.DEFAULT_DISK_CACHE_DIR)),
+ )
+ }
+
+ /** Empties the three caches; downloads are kept. The covers in memory are dropped too, on the main thread. */
+ @androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
+ suspend fun clearCaches(context: Context) {
+ withContext(Dispatchers.IO) {
+ // Through the cache itself: it keeps an index of its files (a video playing finishes from its buffer).
+ runCatching {
+ val media = com.music.spotui.di.SongPlayer.mediaCache(context.applicationContext)
+ media.keys.toList().forEach { runCatching { media.removeResource(it) } }
+ }
+ runCatching { com.music.spotui.automix.AutoMix.clearCache() }
+ runCatching { com.bumptech.glide.Glide.get(context).clearDiskCache() }
+ }
+ withContext(Dispatchers.Main) { runCatching { com.bumptech.glide.Glide.get(context).clearMemory() } }
+ }
+
+ private fun size(dir: File): Long = runCatching { dir.walk().filter { it.isFile }.sumOf { it.length() } }.getOrDefault(0L)
+}
diff --git a/base/app/src/main/java/com/music/spotui/data/api/LyricTranslate.kt b/base/app/src/main/java/com/music/spotui/data/api/LyricTranslate.kt
index c3df7043..8962d529 100644
--- a/base/app/src/main/java/com/music/spotui/data/api/LyricTranslate.kt
+++ b/base/app/src/main/java/com/music/spotui/data/api/LyricTranslate.kt
@@ -47,10 +47,26 @@ object LyricTranslate {
private data class Response(val text: String, val sourceLanguage: String?)
+ /**
+ * The target as the translator names it: the app's languages carry regions ("pt-BR", "fr-CA",
+ * "zh-TW") it mostly does not take; only Chinese and Portuguese keep theirs.
+ */
+ internal fun translatorTag(tag: String): String {
+ val t = tag.replace('_', '-')
+ val lang = t.substringBefore('-').lowercase()
+ val region = t.substringAfter('-', "").uppercase()
+ return when (lang) {
+ "zh" -> if (region == "TW" || region == "HK" || region == "HANT") "zh-TW" else "zh-CN"
+ "pt" -> if (region == "PT") "pt-PT" else "pt"
+ "in" -> "id"
+ else -> lang
+ }
+ }
+
private fun translateText(text: String, targetLang: String): Response? = runCatching {
com.music.spotui.data.DataSaver.check()
val q = URLEncoder.encode(text, "UTF-8")
- val tl = URLEncoder.encode(targetLang, "UTF-8")
+ val tl = URLEncoder.encode(translatorTag(targetLang), "UTF-8")
val conn = (URL(
"https://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=$tl&dt=t&q=$q"
).openConnection() as HttpURLConnection).apply {
diff --git a/base/app/src/main/java/com/music/spotui/data/api/LyricsApi.kt b/base/app/src/main/java/com/music/spotui/data/api/LyricsApi.kt
index e77ca741..23a085ee 100644
--- a/base/app/src/main/java/com/music/spotui/data/api/LyricsApi.kt
+++ b/base/app/src/main/java/com/music/spotui/data/api/LyricsApi.kt
@@ -160,8 +160,12 @@ object LyricsApi {
// One request per track even when the card and the full screen ask together.
val job = synchronized(inFlight) {
inFlight[track.key] ?: scope.async(start = kotlinx.coroutines.CoroutineStart.LAZY) {
- // Read on an earlier run: from storage, not asked for again.
- LyricsDisk.read(track.key)?.also { cache[track.key] = it } ?: resolve(track)
+ // Read on an earlier run: from storage, not asked for again. A downloaded song's own
+ // (see [keepForOffline]) when there is no connection, or when nothing else had any.
+ LyricsDisk.read(track.key)?.also { cache[track.key] = it }
+ ?: (if (online()) null else kept(track))
+ ?: resolve(track)
+ ?: kept(track)
}.also { created ->
inFlight[track.key] = created
created.invokeOnCompletion {
@@ -286,7 +290,7 @@ object LyricsApi {
pending -> Partial(result)
else -> result
}
- if (!pending) result?.let { LyricsDisk.write(track.key, it) }
+ if (!pending) result?.let { LyricsDisk.write(track.key, it); keepIfDownloaded(track, it) }
Log.d("LyricsApi", "${track.title}: ${result?.let { "${it.lines.size} lines from ${it.provider}, synced=${it.synced}, words=${it.wordSynced}" } ?: "none"}" +
if (pending) " (the extensions did not answer in time)" else "")
result
@@ -346,7 +350,7 @@ object LyricsApi {
?.sortedByDescending { it.lastModified() }?.drop(MAX_FILES)?.forEach { it.delete() }
}
- private fun encode(l: Lyrics) = JSONObject()
+ fun encode(l: Lyrics) = JSONObject()
.put("synced", l.synced).put("language", l.language).put("provider", l.provider)
.put("trl", l.translationLanguage)
.put("colors", l.colors?.let { JSONArray(listOf(it.background, it.text, it.highlight)) })
@@ -368,7 +372,7 @@ object LyricsApi {
private fun wordsOf(wa: JSONArray?) = wa?.let { List(it.length()) { j -> it.getJSONArray(j).let { w -> LyricWord(w.getLong(0), w.getLong(1), w.getString(2)) } } }
// Entries written before translations, voices and backing vocals existed lack their keys: they read as none.
- private fun decode(o: JSONObject): Lyrics {
+ fun decode(o: JSONObject): Lyrics {
val colors = o.optJSONArray("colors")?.let { LyricsColors(it.getInt(0), it.getInt(1), it.getInt(2)) }
val lines = o.getJSONArray("lines").let { arr ->
List(arr.length()) { i ->
@@ -385,6 +389,59 @@ object LyricsApi {
}
}
+ /**
+ * The lyrics kept with a downloaded song (OfflineStore.lyricsFile), for as long as the song is:
+ * read when there is no connection or no source had any, and written again when found anew.
+ * Shown as a [Partial]: the song is looked up again a while later, when there may be a connection.
+ */
+ private fun kept(track: Track): Lyrics? = runCatching {
+ val f = com.music.spotui.data.offline.OfflineStore.lyricsFile(track.trackId)?.takeIf { it.isFile } ?: return null
+ LyricsDisk.decode(JSONObject(f.readText()))
+ }.getOrNull()?.takeUnless { it.isEmpty }?.also {
+ cache[track.key] = Partial(it)
+ Log.d("LyricsApi", "${track.title}: ${it.lines.size} lines kept with the download")
+ }
+
+ /** What can be kept with a download: lyrics with lines, not a Free account's cut-short preview. */
+ internal fun keepable(lyrics: Lyrics): Boolean = !lyrics.isEmpty && lyrics.uncapped
+
+ private fun keep(track: Track, lyrics: Lyrics) {
+ if (!keepable(lyrics)) return
+ runCatching {
+ val f = com.music.spotui.data.offline.OfflineStore.lyricsFile(track.trackId) ?: return
+ f.parentFile?.mkdirs()
+ com.music.spotui.data.writeTextSafely(f, LyricsDisk.encode(lyrics).toString(), sync = false)
+ }.onFailure { Log.w("LyricsApi", "could not keep lyrics with the download: ${it.javaClass.simpleName}") }
+ }
+
+ /** Lyrics found for a downloaded song replace the ones kept with it (the setting on). */
+ private fun keepIfDownloaded(track: Track, lyrics: Lyrics) {
+ if (!runCatching { com.music.spotui.data.preferences.LyricsOfflinePref.on &&
+ com.music.spotui.data.offline.OfflineStore.isDownloaded(track.trackId) }.getOrDefault(false)) return
+ keep(track, lyrics)
+ }
+
+ // Downloads ask for their lyrics one song at a time, behind what is shown: an extension answers one call at a time.
+ private val keeping = kotlinx.coroutines.sync.Mutex()
+
+ /**
+ * A song was just downloaded ("Download lyrics with songs" on): its lyrics are looked up the usual
+ * way ([fetch], the lyrics extensions included) and kept with the download, for playing offline.
+ */
+ fun keepForOffline(track: Track) {
+ if (track.trackId.isBlank()) return
+ scope.launch {
+ keeping.lock()
+ try {
+ val lyrics = runCatching { fetch(track) }.getOrNull() ?: return@launch
+ keep(track, lyrics)
+ } finally { keeping.unlock() }
+ }
+ }
+
+ private fun online(): Boolean =
+ runCatching { com.music.spotui.data.offline.OfflineStore.isOnline(com.music.spotui.di.Graph.app) }.getOrDefault(true)
+
/** Whether lyrics extensions are installed and running (false in unit tests: no app). */
private fun extensionsAsked(): Boolean = runCatching { com.music.spotui.extensions.Extensions.hasLyrics() }.getOrDefault(false)
diff --git a/base/app/src/main/java/com/music/spotui/data/local/LocalMusic.kt b/base/app/src/main/java/com/music/spotui/data/local/LocalMusic.kt
index e6a6c6bc..cc22375c 100644
--- a/base/app/src/main/java/com/music/spotui/data/local/LocalMusic.kt
+++ b/base/app/src/main/java/com/music/spotui/data/local/LocalMusic.kt
@@ -31,6 +31,8 @@ data class LocalTrack(
val isRadio: Boolean = false,
/** MediaStore's track number (disc × 1000 + track), 0 unknown (streams and downloads have none). */
val trackNo: Int = 0,
+ /** A podcast episode or an audiobook (spoken word): AutoMix leaves it whole unless asked. */
+ val speech: Boolean = false,
)
/** The device's music files, read through MediaStore (no file access beyond audio). */
@@ -63,6 +65,7 @@ object LocalMusic {
MediaStore.Audio.Media._ID, MediaStore.Audio.Media.TITLE, MediaStore.Audio.Media.ARTIST,
MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.DURATION, MediaStore.Audio.Media.ALBUM_ID,
MediaStore.Audio.Media.RELATIVE_PATH, MediaStore.Audio.Media.TRACK,
+ MediaStore.Audio.Media.IS_PODCAST, MediaStore.Audio.Media.IS_AUDIOBOOK,
)
val out = ArrayList<LocalTrack>()
// Android's index decides what is "music": a phone full of recorded or downloaded audio can
@@ -87,6 +90,8 @@ object LocalMusic {
val iAlbumId = c.getColumnIndexOrThrow(MediaStore.Audio.Media.ALBUM_ID)
val iPath = c.getColumnIndex(MediaStore.Audio.Media.RELATIVE_PATH)
val iTrack = c.getColumnIndex(MediaStore.Audio.Media.TRACK)
+ val iPodcast = c.getColumnIndex(MediaStore.Audio.Media.IS_PODCAST)
+ val iBook = c.getColumnIndex(MediaStore.Audio.Media.IS_AUDIOBOOK)
while (c.moveToNext()) {
val id = c.getLong(iId)
val artist = c.getString(iArtist)?.takeIf { it != MediaStore.UNKNOWN_STRING }.orEmpty()
@@ -100,6 +105,7 @@ object LocalMusic {
artUri = ContentUris.withAppendedId(Uri.parse("content://media/external/audio/albumart"), c.getLong(iAlbumId)),
folder = if (iPath >= 0) c.getString(iPath).orEmpty() else "",
trackNo = if (iTrack >= 0 && !c.isNull(iTrack)) c.getInt(iTrack).coerceAtLeast(0) else 0,
+ speech = (iPodcast >= 0 && c.getInt(iPodcast) != 0) || (iBook >= 0 && c.getInt(iBook) != 0),
)
}
}
diff --git a/base/app/src/main/java/com/music/spotui/data/offline/OfflineDownloader.kt b/base/app/src/main/java/com/music/spotui/data/offline/OfflineDownloader.kt
index be4f5345..a6c08fc5 100644
--- a/base/app/src/main/java/com/music/spotui/data/offline/OfflineDownloader.kt
+++ b/base/app/src/main/java/com/music/spotui/data/offline/OfflineDownloader.kt
@@ -270,6 +270,9 @@ object OfflineDownloader {
// Already on the IO scope: the index rewrite stays off the main thread.
OfflineStore.add(t)
withContext(Dispatchers.Main) { requests.remove(r.trackId) }
+ // Its lyrics kept with it, for playing offline (looked up behind, one song at a time).
+ if (com.music.spotui.data.preferences.LyricsOfflinePref.on) com.music.spotui.data.api.LyricsApi.keepForOffline(
+ com.music.spotui.data.api.LyricsApi.Track(r.trackId, r.title, r.artist, r.album, r.durationMs, r.coverUrl))
null
} catch (e: CancellationException) {
throw e
diff --git a/base/app/src/main/java/com/music/spotui/data/offline/OfflineStore.kt b/base/app/src/main/java/com/music/spotui/data/offline/OfflineStore.kt
index 345e645a..b86f9746 100644
--- a/base/app/src/main/java/com/music/spotui/data/offline/OfflineStore.kt
+++ b/base/app/src/main/java/com/music/spotui/data/offline/OfflineStore.kt
@@ -162,6 +162,8 @@ object OfflineStore {
if (kept.size != list.size) writeIndex()
audioDir.listFiles()?.forEach { if (it.name !in names) it.delete() }
coverDir.listFiles()?.forEach { if (it.name !in covers) it.delete() }
+ val lyrics = kept.map { lyricsName(it.trackId) }.toSet()
+ lyricsDir.listFiles()?.forEach { if (it.name !in lyrics) it.delete() }
} else {
val aside = keepAside(audioDir, names, File(recoveredDir, "audio")) + keepAside(coverDir, covers, File(recoveredDir, "covers"))
if (aside > 0) runCatching { app.myspoti.host.android.Logbook.log("offline: download index not read in full; $aside files the index does not list kept in ${recoveredDir.name}/") }
@@ -183,6 +185,15 @@ object OfflineStore {
val audioDir: File get() = File(root, "audio")
val coverDir: File get() = File(root, "covers")
+ /** The lyrics kept with the downloaded songs (see LyricsApi.keepForOffline), one file each. */
+ private val lyricsDir: File get() = File(root, "lyrics")
+ private fun lyricsName(trackId: String) = "$trackId.json"
+
+ /** Where [trackId]'s lyrics are kept with its download; null for no id, one unfit for a file name, or before [init]. */
+ fun lyricsFile(trackId: String): File? =
+ if (!::root.isInitialized || !trackId.matches(SAFE_ID)) null else File(lyricsDir, lyricsName(trackId))
+
+ private val SAFE_ID = Regex("[A-Za-z0-9]{1,64}")
private val indexFile: File get() = File(root, "index.json")
/** The index before the last write, the fallback when [indexFile] is damaged. */
private val backupFile: File get() = File(root, "index.json.bak")
@@ -212,6 +223,7 @@ object OfflineStore {
val t = tracks.remove(trackId) ?: return
File(audioDir, t.file).delete()
if (t.cover.isNotBlank()) File(coverDir, t.cover).delete()
+ lyricsFile(trackId)?.delete()
writeIndex()
deleted(listOf(t))
}
@@ -224,6 +236,7 @@ object OfflineStore {
status.clear()
audioDir.listFiles()?.forEach { it.delete() }
coverDir.listFiles()?.forEach { it.delete() }
+ lyricsDir.listFiles()?.forEach { it.delete() }
writeIndex()
deleted(all)
}
@@ -268,6 +281,7 @@ object OfflineStore {
album = t.album,
durationMs = t.durationMs,
artUri = coverFile(t)?.let { Uri.fromFile(it) } ?: Uri.parse(app.myspoti.host.android.Covers.large(t.coverUrl)),
+ speech = t.isEpisode,
)
fun toSong(t: OfflineTrack) = SongsModel(
diff --git a/base/app/src/main/java/com/music/spotui/data/preferences/AppearancePref.kt b/base/app/src/main/java/com/music/spotui/data/preferences/AppearancePref.kt
new file mode 100644
index 00000000..8eac93ea
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/data/preferences/AppearancePref.kt
@@ -0,0 +1,90 @@
+package com.music.spotui.data.preferences
+
+/*
+ * Appearance choices on top of the look: the wallpaper's colours (Material You) for the Classic
+ * look, and the font of both looks. Compose state, so every screen redraws when one changes.
+ */
+
+import android.content.Context
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.graphics.Color
+
+private const val PREF = "settings_prefs"
+
+private fun prefs(c: Context) = c.getSharedPreferences(PREF, Context.MODE_PRIVATE)
+
+/**
+ * "Dynamic colors (Material You)": the Classic look's accent taken from the wallpaper (Android 12
+ * and later), in place of the accent chosen in the settings. Off by default. The Immersive look
+ * keeps its own colours, taken from the playing cover.
+ */
+object DynamicColorPref {
+ private const val KEY = "dynamic_color"
+
+ /** The phone has wallpaper colours to give (Android 12 and later). */
+ val available: Boolean get() = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S
+
+ var on by mutableStateOf(prefs(com.music.spotui.di.Graph.app).getBoolean(KEY, false))
+ private set
+
+ /** On, and the phone can give the colours. */
+ val active: Boolean get() = on && available
+
+ fun set(c: Context, value: Boolean) {
+ on = value
+ cached = null
+ prefs(c).edit().putBoolean(KEY, value).apply()
+ }
+
+ // The wallpaper's accent, read once per configuration (see [refresh]): it is asked at every draw.
+ @Volatile private var cached: Color? = null
+
+ /** The configuration changed (a new wallpaper recreates the activity): the accent is read again. */
+ fun refresh() { cached = null }
+
+ /**
+ * The wallpaper's accent for the Classic look, or null (off, Immersive, before Android 12). The
+ * same tone Material's dynamic dark scheme gives its primary colour (system_accent1_200).
+ */
+ fun accent(): Color? {
+ if (!on || android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.S || LookPref.look != Look.CLASSIC) return null
+ cached?.let { return it }
+ return runCatching { Color(com.music.spotui.di.Graph.app.getColor(android.R.color.system_accent1_200)) }
+ .getOrNull()?.also { cached = it }
+ }
+}
+
+/**
+ * "App font": Myspoti's own fonts (Manrope in the Classic look, Inter in the Immersive one, the
+ * default) or the phone's system font. No font is bundled for it: the system one is the phone's.
+ */
+object AppFontPref {
+ private const val KEY = "system_font"
+
+ /** True: the phone's system font everywhere in the app. */
+ var system by mutableStateOf(prefs(com.music.spotui.di.Graph.app).getBoolean(KEY, false))
+ private set
+
+ fun set(c: Context, value: Boolean) {
+ system = value
+ prefs(c).edit().putBoolean(KEY, value).apply()
+ }
+}
+
+/**
+ * "Download lyrics with songs": a downloaded song's lyrics are looked up and kept with it, so the
+ * lyrics show without a connection. On by default.
+ */
+object LyricsOfflinePref {
+ private const val KEY = "download_lyrics"
+
+ var on by mutableStateOf(prefs(com.music.spotui.di.Graph.app).getBoolean(KEY, true))
+ private set
+
+ fun set(c: Context, value: Boolean) {
+ on = value
+ prefs(c).edit().putBoolean(KEY, value).apply()
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/data/preferences/SettingsPref.kt b/base/app/src/main/java/com/music/spotui/data/preferences/SettingsPref.kt
index d6af667b..c0e96593 100644
--- a/base/app/src/main/java/com/music/spotui/data/preferences/SettingsPref.kt
+++ b/base/app/src/main/java/com/music/spotui/data/preferences/SettingsPref.kt
@@ -184,10 +184,15 @@ object CrossfadePref {
/**
* How the local player's songs follow each other: one choice over [CrossfadePref] and AutoMix,
* which never run together (AutoMix on, the crossfade's length is kept for later but unused).
+ * Spotify songs, which AutoMix cannot mix (the app never has the Web Player's audio), then change
+ * with a short fade of [SPOTIFY_FADE_SECONDS] rather than with that kept length (up to 12 s).
*/
object TransitionPref {
enum class Mode { OFF, CROSSFADE, AUTOMIX }
+ /** The Spotify songs' fade while AutoMix is on, seconds. */
+ const val SPOTIFY_FADE_SECONDS = 3
+
val mode: Mode get() = when {
com.music.spotui.automix.AutoMix.on -> Mode.AUTOMIX
CrossfadePref.seconds > 0 -> Mode.CROSSFADE
@@ -247,7 +252,8 @@ fun getCrossfadeSeconds(c: Context): Int =
fun applyCrossfade(seconds: Int) {
val runtime = app.myspoti.host.android.MyspotiRuntime
if (!runtime.isStarted) return
- runtime.spotify.player.crossfadeSeconds = seconds
+ // AutoMix on: the crossfade length is only kept for later, the Spotify songs get a short fade.
+ runtime.spotify.player.crossfadeSeconds = if (com.music.spotui.automix.AutoMix.on) TransitionPref.SPOTIFY_FADE_SECONDS else seconds
}
fun getLyricTranslateLang(c: Context): String =
diff --git a/base/app/src/main/java/com/music/spotui/data/preferences/SponsorBlockPref.kt b/base/app/src/main/java/com/music/spotui/data/preferences/SponsorBlockPref.kt
new file mode 100644
index 00000000..1da7c7c6
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/data/preferences/SponsorBlockPref.kt
@@ -0,0 +1,43 @@
+package com.music.spotui.data.preferences
+
+import android.content.Context
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import com.music.spotui.di.Graph
+import com.music.spotui.podcast.SponsorSegments
+
+/**
+ * SponsorBlock for podcasts ([com.music.spotui.podcast.SponsorSkip]): off by default, since it
+ * asks sponsor.ajay.app (and YouTube) about the episodes played. Which parts it skips: sponsor
+ * reads on, the rest off until chosen.
+ */
+object SponsorBlockPref {
+ private const val PREF = "sponsorblock"
+ private fun prefs(c: Context) = c.getSharedPreferences(PREF, Context.MODE_PRIVATE)
+
+ var on by mutableStateOf(prefs(Graph.app).getBoolean("on", false))
+ private set
+ var sponsor by mutableStateOf(prefs(Graph.app).getBoolean("sponsor", true))
+ private set
+ var selfPromo by mutableStateOf(prefs(Graph.app).getBoolean("selfpromo", false))
+ private set
+ var introOutro by mutableStateOf(prefs(Graph.app).getBoolean("intro_outro", false))
+ private set
+ var interaction by mutableStateOf(prefs(Graph.app).getBoolean("interaction", false))
+ private set
+
+ fun set(c: Context, value: Boolean) { on = value; prefs(c).edit().putBoolean("on", value).apply() }
+ fun setSponsor(c: Context, value: Boolean) { sponsor = value; prefs(c).edit().putBoolean("sponsor", value).apply() }
+ fun setSelfPromo(c: Context, value: Boolean) { selfPromo = value; prefs(c).edit().putBoolean("selfpromo", value).apply() }
+ fun setIntroOutro(c: Context, value: Boolean) { introOutro = value; prefs(c).edit().putBoolean("intro_outro", value).apply() }
+ fun setInteraction(c: Context, value: Boolean) { interaction = value; prefs(c).edit().putBoolean("interaction", value).apply() }
+
+ /** The categories to skip, as the server names them. */
+ fun categories(): Set<String> = buildSet {
+ if (sponsor) add(SponsorSegments.SPONSOR)
+ if (selfPromo) add(SponsorSegments.SELF_PROMO)
+ if (introOutro) { add(SponsorSegments.INTRO); add(SponsorSegments.OUTRO) }
+ if (interaction) add(SponsorSegments.INTERACTION)
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/di/Graph.kt b/base/app/src/main/java/com/music/spotui/di/Graph.kt
index 24c5cd8a..f1c400d1 100644
--- a/base/app/src/main/java/com/music/spotui/di/Graph.kt
+++ b/base/app/src/main/java/com/music/spotui/di/Graph.kt
@@ -39,6 +39,8 @@ object Graph {
// Live Radio: its own setting and favorites file (see com.music.spotui.radio).
com.music.spotui.radio.RadioFeaturePref.init(application)
com.music.spotui.radio.RadioFavoritesStore.init(application)
+ // SponsorBlock for podcasts: idle until turned on in the settings.
+ com.music.spotui.podcast.SponsorSkip.init()
}
val api: Api by lazy { Api(app) }
diff --git a/base/app/src/main/java/com/music/spotui/di/LocalPlayer.kt b/base/app/src/main/java/com/music/spotui/di/LocalPlayer.kt
index aa8b25b5..3729d977 100644
--- a/base/app/src/main/java/com/music/spotui/di/LocalPlayer.kt
+++ b/base/app/src/main/java/com/music/spotui/di/LocalPlayer.kt
@@ -532,7 +532,7 @@ object LocalPlayer {
if (!p.isPlaying) return false
val next = p.nextMediaItemIndex
val canMix = next != C.INDEX_UNSET && !LocalRepeat.loopsSong(repeat, p.mediaItemCount) && p.playWhenReady
- if (!canMix) { if (m != null) cancelMix("no next song"); return true }
+ if (!canMix) { if (m != null) cancelMix("no next song"); whyNot(null); return true }
val nextId = p.getMediaItemAt(next).mediaId
// The next song changed (queue edited): the deck prepared for another one goes.
if (m != null && (m.toIndex != next || m.toId != nextId)) cancelMix("the next song changed")
@@ -583,12 +583,23 @@ object LocalPlayer {
return if (exit - p.currentPosition > PREPARE_LEAD_MS + RUN_UP_MS + 3_000) 1_000 else 200
}
+ /** Why the next pair is not mixed, for the screens (see AutoMix.whyNot). */
+ private fun whyNot(r: com.music.spotui.automix.AutoMix.Reason?) {
+ if (com.music.spotui.automix.AutoMix.pairReason.value != r) com.music.spotui.automix.AutoMix.pairReason.value = r
+ }
+
+ /** A podcast episode or an audiobook at either end, with "Mix podcasts" off: the two are not mixed. */
+ private fun spoken(a: LocalTrack?, b: LocalTrack?): Boolean =
+ !com.music.spotui.automix.AutoMix.mixPodcasts && (a?.speech == true || b?.speech == true)
+
/** The plan for this pair: the analysed one, else (once the end is near) a fade on the songs' lengths. */
private fun planFor(p: ExoPlayer, next: Int, nextId: String): app.myspoti.automix.MixPlan? {
val cur = p.currentMediaItemIndex
planned?.takeIf { it.fromIndex == cur && it.toId == nextId }?.let { return it.plan }
val a = tracks.getOrNull(cur) ?: return null
val b = tracks.getOrNull(next) ?: return null
+ // Spoken word starts and ends whole (and is not analysed).
+ if (spoken(a, b)) { whyNot(com.music.spotui.automix.AutoMix.Reason.Podcast); return null }
// Asked again whenever the songs ahead change (a queue edit): the next one and the one after it.
val ahead = "$cur|$nextId|${p.getMediaItemAt(next).mediaId}|${if (next + 1 < p.mediaItemCount) p.getMediaItemAt(next + 1).mediaId else ""}"
if (asking != ahead) {
@@ -598,20 +609,26 @@ object LocalPlayer {
if (followsOnAlbum(a, b)) com.music.spotui.automix.AutoMix.journal("${a.title} → ${b.title}: next on the album, no mix")
}
// B right after A on their album: they run into each other as the album does (a skip still mixes).
- if (followsOnAlbum(a, b)) return null
+ if (followsOnAlbum(a, b)) { whyNot(com.music.spotui.automix.AutoMix.Reason.Album); return null }
val ra = com.music.spotui.automix.AutoMix.analysis(a.uri); val rb = com.music.spotui.automix.AutoMix.analysis(b.uri)
if (ra != null && rb != null) {
val plan = com.music.spotui.automix.AutoMix.planFor(ra, rb)
planned = Planned(cur, nextId, plan)
+ whyNot(null)
com.music.spotui.automix.AutoMix.journal("plan ${a.title} → ${b.title}: $plan")
return plan
}
- // Not analysed yet with the end near: an equal-power fade of 6 s on the lengths.
+ // A song refused for now (mobile data, a failed analysis) says so at once; one still under way, once the end is near.
+ val refused = (if (ra == null) com.music.spotui.automix.AutoMix.missing(a.uri) else null) ?: (if (rb == null) com.music.spotui.automix.AutoMix.missing(b.uri) else null)
+ whyNot(refused)
+ // Not analysed yet with the end near: an equal-power fade on the lengths (6 s, or the smooth fade's own).
val dur = p.duration.takeIf { it > 0 } ?: return null
if (dur - p.currentPosition > PREPARE_LEAD_MS + RUN_UP_MS + 1000) return null
- val len = minOf(6.0, dur / 4000.0)
+ val settings = com.music.spotui.automix.AutoMix.settings()
+ val len = minOf(if (settings.style == app.myspoti.automix.MixPlan.Style.FADE) settings.smoothSec else 6.0, dur / 4000.0)
val plan = app.myspoti.automix.MixPlan(app.myspoti.automix.MixPlan.Style.FADE, dur / 1000.0 - len, 0.0, len, 1.0, 0, 0.5, 0.1, 1.0, 0.0, "fade: not analysed in time")
planned = Planned(cur, nextId, plan)
+ whyNot(refused ?: if (com.music.spotui.automix.AutoMix.frugal()) com.music.spotui.automix.AutoMix.Reason.Frugal else com.music.spotui.automix.AutoMix.Reason.NotAnalyzed)
com.music.spotui.automix.AutoMix.journal("plan ${a.title} → ${b.title}: $plan")
return plan
}
@@ -647,7 +664,7 @@ object LocalPlayer {
val b = tracks.getOrNull(next)?.let { com.music.spotui.automix.AutoMix.analysis(it.uri) }
// A skip may stretch more than a natural mix (12 %): it is short, and B is back to its tempo soon after.
return app.myspoti.automix.MixPlanner.planSkip(a, b, posMs / 1000.0, (SKIP_RUN_UP_MS + startLead) / 1000.0,
- com.music.spotui.automix.AutoMix.settings().let { app.myspoti.automix.MixPlanner.Settings(maxStretch = maxOf(it.maxStretch, 0.12), lengthBias = it.lengthBias) })
+ com.music.spotui.automix.AutoMix.settings().let { app.myspoti.automix.MixPlanner.Settings(maxStretch = maxOf(it.maxStretch, 0.12), lengthBias = it.lengthBias, style = it.style) })
}
/**
@@ -661,6 +678,7 @@ object LocalPlayer {
mix?.let { if (it.skip || it.state >= MixState.PREROLL) return false }
val next = p.nextMediaItemIndex
if (next == C.INDEX_UNSET || LocalRepeat.loopsSong(repeat, p.mediaItemCount)) return false
+ if (spoken(tracks.getOrNull(p.currentMediaItemIndex), tracks.getOrNull(next))) return false
cancelMix("skip", again = true)
val plan = skipPlan(p, next, p.currentPosition)
com.music.spotui.automix.AutoMix.journal("skip: $plan")
@@ -890,7 +908,7 @@ object LocalPlayer {
/** A planner setting changed (length, tempo range): the next mix is planned again unless it already started. */
fun autoMixSettingsChanged() {
- if (mix == null) { planned = null; updateCue() }
+ if (mix == null) { planned = null; asking = null; updateCue() }
}
/** For the command line: where the mix stands. */
diff --git a/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt b/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt
index 93122f3d..cfa9ec87 100644
--- a/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt
+++ b/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt
@@ -3026,7 +3026,7 @@ object SongPlayer {
null
}
- // Media cache for the looping Canvas video on the now-playing screen.
+ // Media cache for the looping Canvas video on the now-playing screen, sized as Settings > Storage says (at its first use).
@Volatile private var mediaCache: androidx.media3.datasource.cache.SimpleCache? = null
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
@@ -3034,7 +3034,7 @@ object SongPlayer {
mediaCache ?: synchronized(this) {
mediaCache ?: androidx.media3.datasource.cache.SimpleCache(
java.io.File(context.cacheDir, "media"),
- androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor(64L * 1024 * 1024),
+ androidx.media3.datasource.cache.LeastRecentlyUsedCacheEvictor(com.music.spotui.data.AppStorage.mediaCacheLimit()),
androidx.media3.database.StandaloneDatabaseProvider(context),
).also { mediaCache = it }
}
diff --git a/base/app/src/main/java/com/music/spotui/extensions/ExtensionAudio.kt b/base/app/src/main/java/com/music/spotui/extensions/ExtensionAudio.kt
index 6246440a..a364f0a7 100644
--- a/base/app/src/main/java/com/music/spotui/extensions/ExtensionAudio.kt
+++ b/base/app/src/main/java/com/music/spotui/extensions/ExtensionAudio.kt
@@ -228,6 +228,7 @@ object ExtensionAudio {
OfflineStore.tracks[s.spotifyTrackId]?.takeIf { OfflineStore.isDownloaded(s.spotifyTrackId) }?.let(OfflineStore::toLocalTrack) ?: LocalTrack(
id = OfflineStore.localIdOf(s.spotifyTrackId), uri = uri(s), title = s.title, artist = s.singer,
album = s.album, durationMs = s.durationMs.toLong(), artUri = Uri.parse(s.coverUri),
+ speech = com.music.spotui.data.offline.episodeKeyOf(s) != null || s.url.startsWith("spotify:episode:"),
)
/**
diff --git a/base/app/src/main/java/com/music/spotui/podcast/SponsorSegments.kt b/base/app/src/main/java/com/music/spotui/podcast/SponsorSegments.kt
new file mode 100644
index 00000000..261e90f2
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/podcast/SponsorSegments.kt
@@ -0,0 +1,183 @@
+package com.music.spotui.podcast
+
+import kotlinx.serialization.json.Json
+import kotlinx.serialization.json.JsonArray
+import kotlinx.serialization.json.JsonObject
+import kotlinx.serialization.json.contentOrNull
+import kotlinx.serialization.json.doubleOrNull
+import kotlinx.serialization.json.jsonPrimitive
+import java.security.MessageDigest
+import java.text.Normalizer
+import java.util.Locale
+import kotlin.math.abs
+import kotlin.math.roundToLong
+
+/**
+ * The pure part of SponsorBlock for podcasts: reading the server's answer, keeping the segments
+ * that fit the episode playing, telling whether a YouTube upload is that same episode, and which
+ * segment to skip now.
+ *
+ * SponsorBlock (https://sponsor.ajay.app, API: https://wiki.sponsor.ajay.app/w/API_Docs) is a
+ * crowdsourced list of the sponsor reads and other parts of a video, by video id. Its server also
+ * holds Spotify episodes (`service=Spotify`, keyed by the episode's base62 id: what the Spot
+ * SponsorBlock browser extension submits, https://github.com/Spot-SponsorBlock/Spot-SponsorBlock-Extension),
+ * so an episode is asked by its own id first; a YouTube upload of it is only the fallback.
+ * Both are asked by hash prefix ([hashPrefix]): the server never learns which episode plays.
+ */
+internal object SponsorSegments {
+ /** The categories the settings offer, as the server names them. */
+ const val SPONSOR = "sponsor"
+ const val SELF_PROMO = "selfpromo"
+ const val INTRO = "intro"
+ const val OUTRO = "outro"
+ const val INTERACTION = "interaction"
+ val ALL_CATEGORIES = listOf(SPONSOR, SELF_PROMO, INTRO, OUTRO, INTERACTION)
+
+ /** Hex characters of the id's SHA-256 sent to the server (it accepts 4 to 32; 4 hides the id among thousands). */
+ const val HASH_PREFIX = 4
+ /** A segment marked on a copy longer or shorter than this (in ms) is not placed on the one playing. */
+ const val DURATION_TOLERANCE_MS = 3_000L
+ /** A YouTube upload is the same episode only when its length is this close (in ms). */
+ const val YOUTUBE_DURATION_TOLERANCE_MS = 2_000L
+ /** Shorter segments are not worth a seek. */
+ const val MIN_SEGMENT_MS = 1_000L
+ /** Segments closer than this are skipped as one. */
+ const val MERGE_GAP_MS = 1_000L
+ /** Episode title words a YouTube upload must carry, at least. */
+ const val MIN_TITLE_COVERAGE = 0.8
+
+ data class Segment(val startMs: Long, val endMs: Long, val category: String, val uuid: String, val videoDurationMs: Long = 0L)
+
+ private val json = Json { ignoreUnknownKeys = true }
+
+ fun sha256Hex(s: String): String =
+ MessageDigest.getInstance("SHA-256").digest(s.toByteArray(Charsets.UTF_8)).joinToString("") { "%02x".format(it) }
+
+ fun hashPrefix(id: String): String = sha256Hex(id).take(HASH_PREFIX)
+
+ /**
+ * The skip segments of [videoId] in a hash-prefix answer (`[{videoID, segments: [{segment:
+ * [start, end], category, actionType, UUID, videoDuration}]}]`, other ids sharing the prefix
+ * included). Only `skip` segments: `mute`, `full` (a label for the whole episode) and `poi`
+ * are not parts to jump over. Null when the answer cannot be read.
+ */
+ fun parse(body: String, videoId: String): List<Segment>? {
+ val root = runCatching { json.parseToJsonElement(body) }.getOrNull() as? JsonArray ?: return null
+ val entry = root.firstOrNull { (it as? JsonObject)?.str("videoID") == videoId } as? JsonObject ?: return emptyList()
+ val segments = entry["segments"] as? JsonArray ?: return emptyList()
+ return segments.mapNotNull { el ->
+ val o = el as? JsonObject ?: return@mapNotNull null
+ if ((o.str("actionType") ?: "skip") != "skip") return@mapNotNull null
+ val range = o["segment"] as? JsonArray ?: return@mapNotNull null
+ if (range.size != 2) return@mapNotNull null
+ val start = range[0].seconds() ?: return@mapNotNull null
+ val end = range[1].seconds() ?: return@mapNotNull null
+ Segment(
+ startMs = start, endMs = end,
+ category = o.str("category") ?: return@mapNotNull null,
+ uuid = o.str("UUID").orEmpty(),
+ videoDurationMs = o["videoDuration"]?.seconds() ?: 0L,
+ )
+ }
+ }
+
+ private fun JsonObject.str(key: String): String? = runCatching { this[key]?.jsonPrimitive?.contentOrNull }.getOrNull()
+
+ private fun kotlinx.serialization.json.JsonElement.seconds(): Long? =
+ runCatching { jsonPrimitive.doubleOrNull }.getOrNull()?.takeIf { it >= 0 }?.let { (it * 1000).roundToLong() }
+
+ /**
+ * The segments to skip in an episode [durationMs] long (0: not known yet), sorted, of the
+ * [categories] chosen. A segment marked on a copy of another length is left out (an ad
+ * inserted for that listener moves everything after it); one with no length given is kept.
+ * Overlapping or touching segments become one; the last one ends before the episode does.
+ */
+ fun usable(segments: List<Segment>, durationMs: Long, categories: Set<String>): List<Segment> {
+ val kept = segments.asSequence()
+ .filter { it.category in categories }
+ .filter { durationMs <= 0 || it.videoDurationMs <= 0 || abs(it.videoDurationMs - durationMs) <= DURATION_TOLERANCE_MS }
+ .map { if (durationMs > 0) it.copy(endMs = minOf(it.endMs, durationMs)) else it }
+ .filter { it.endMs - it.startMs >= MIN_SEGMENT_MS }
+ .sortedBy { it.startMs }
+ .toList()
+ val merged = ArrayList<Segment>()
+ for (s in kept) {
+ val last = merged.lastOrNull()
+ if (last != null && s.startMs <= last.endMs + MERGE_GAP_MS) {
+ // The first one's category names the skip; the uuid of both keeps the skip once.
+ merged[merged.size - 1] = last.copy(endMs = maxOf(last.endMs, s.endMs), uuid = last.uuid + "+" + s.uuid)
+ } else merged += s
+ }
+ return merged
+ }
+
+ // --- YouTube fallback: is this upload the episode playing? ---
+
+ private fun fold(s: String): String = Normalizer.normalize(s.replace('’', '\''), Normalizer.Form.NFD)
+ .replace(Regex("""\p{M}+"""), "").lowercase(Locale.ROOT)
+
+ internal fun tokens(s: String): List<String> =
+ fold(s).replace(Regex("""(?<=\p{L})'(?=\p{L})"""), "").split(Regex("""[^\p{L}\p{N}]+""")).filter { it.isNotEmpty() }
+
+ /** The share of the episode title's words found in [candidate] (1.0: all of them). */
+ fun titleCoverage(episodeTitle: String, candidate: String): Double {
+ val want = tokens(episodeTitle).distinct()
+ if (want.isEmpty()) return 0.0
+ val have = tokens(candidate).toSet()
+ return want.count { it in have }.toDouble() / want.size
+ }
+
+ /** The show's name in the upload's title or channel, all its words. */
+ fun showMatches(show: String, name: String, uploader: String): Boolean {
+ val want = tokens(show).distinct()
+ if (want.isEmpty()) return false
+ val have = (tokens(name) + tokens(uploader)).toSet()
+ return want.all { it in have } || tokens(uploader).joinToString("") == want.joinToString("")
+ }
+
+ /**
+ * Whether a YouTube upload ([name] by [uploader], [durationSec] long) is the episode [title]
+ * of [show], [durationMs] long: the same length within 2 s (so the segments need no shift),
+ * most of the title's words, and the show named, or, without it, every word of a title long
+ * enough not to be a coincidence.
+ */
+ fun matches(title: String, show: String, durationMs: Long, name: String, uploader: String, durationSec: Long): Boolean {
+ if (durationMs <= 0 || durationSec <= 0) return false
+ if (abs(durationSec * 1000 - durationMs) > YOUTUBE_DURATION_TOLERANCE_MS) return false
+ val coverage = titleCoverage(title, name)
+ if (coverage < MIN_TITLE_COVERAGE) return false
+ return showMatches(show, name, uploader) || (coverage >= 1.0 && tokens(title).distinct().size >= 4)
+ }
+
+ /** The index of the best upload in [hits] (name, uploader, seconds) that [matches], or -1. */
+ fun best(title: String, show: String, durationMs: Long, hits: List<Triple<String, String, Long>>): Int =
+ hits.indices
+ .filter { matches(title, show, durationMs, hits[it].first, hits[it].second, hits[it].third) }
+ .maxWithOrNull(compareBy<Int> { titleCoverage(title, hits[it].first) }.thenBy { -abs(hits[it].third * 1000 - durationMs) }.thenBy { -it })
+ ?: -1
+}
+
+/**
+ * Which segment to skip, each one once: a segment the playhead enters is skipped, and not again
+ * after that (going back into it, by the Undo or by hand, plays it). A playhead already in its
+ * last [END_MARGIN_MS] lets it end by itself.
+ */
+internal class SkipTracker(val segments: List<SponsorSegments.Segment>) {
+ private val done = HashSet<String>()
+
+ fun due(positionMs: Long): SponsorSegments.Segment? {
+ val s = segments.firstOrNull { positionMs >= it.startMs && positionMs < it.endMs - END_MARGIN_MS && key(it) !in done } ?: return null
+ done += key(s)
+ return s
+ }
+
+ /** How long until the next segment not skipped yet starts (ms), or null when none is left ahead. */
+ fun untilNext(positionMs: Long): Long? =
+ segments.filter { key(it) !in done && it.endMs - END_MARGIN_MS > positionMs }.minOfOrNull { (it.startMs - positionMs).coerceAtLeast(0) }
+
+ private fun key(s: SponsorSegments.Segment) = s.uuid.ifEmpty { "${s.startMs}-${s.endMs}" }
+
+ companion object {
+ const val END_MARGIN_MS = 1_500L
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/podcast/SponsorSkip.kt b/base/app/src/main/java/com/music/spotui/podcast/SponsorSkip.kt
new file mode 100644
index 00000000..0f65f31a
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/podcast/SponsorSkip.kt
@@ -0,0 +1,171 @@
+package com.music.spotui.podcast
+
+import android.util.Log
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import app.myspoti.host.android.Logbook
+import app.myspoti.host.android.MyspotiRuntime
+import com.music.spotui.data.preferences.SponsorBlockPref
+import com.music.spotui.di.Graph
+import com.music.spotui.di.SongPlayer
+import com.music.spotui.video.YouTubeSource
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.runInterruptible
+import kotlinx.coroutines.withContext
+import okhttp3.Request
+
+/**
+ * SponsorBlock for podcasts: while an episode plays, the parts the SponsorBlock community marked
+ * (sponsor reads, and the other categories chosen in the settings) are skipped, each once, with
+ * an Undo ([justSkipped], shown by [SponsorSkipUndo]).
+ *
+ * The episode is asked by its Spotify id first (the server keeps Spotify episodes too); when it
+ * has nothing, a YouTube upload of the same episode (same length within 2 s, the same title and
+ * show) is asked by its video id. Both by hash prefix: only 4 hex characters of the id's SHA-256
+ * leave the phone, with no account, key or user id. Results are kept for the session.
+ */
+object SponsorSkip {
+ private const val TAG = "SponsorSkip"
+ private const val SERVER = "https://sponsor.ajay.app"
+ /** Between checks while an episode with segments plays (a segment is entered within it). */
+ private const val CHECK_MS = 500L
+ /** Between checks while nothing is to be skipped (off, music, paused, nothing ahead). */
+ private const val IDLE_MS = 3_000L
+ /** Episodes whose answer is kept. */
+ private const val CACHE_SIZE = 48
+ /** A failed lookup (no network) is tried again after that. */
+ private const val RETRY_MS = 60_000L
+
+ /** The last skip, for the Undo; null once it is shown or dismissed. */
+ internal class Skipped(val segment: SponsorSegments.Segment, val from: Long)
+ internal var justSkipped by mutableStateOf<Skipped?>(null)
+
+ /** Each episode's segments (all categories; the settings filter them when they are used). */
+ private val cache = object : LinkedHashMap<String, List<SponsorSegments.Segment>>(16, 0.75f, true) {
+ override fun removeEldestEntry(eldest: MutableMap.MutableEntry<String, List<SponsorSegments.Segment>>?) = size > CACHE_SIZE
+ }
+ private var lookup: Job? = null
+ private var lookupUri = ""
+ private var failedAt = 0L
+ private var trackerUri = ""
+ private var trackerKey = ""
+ private var tracker: SkipTracker? = null
+
+ fun init() {
+ MyspotiRuntime.scope.launch(Dispatchers.Main) {
+ while (true) delay(runCatching { tick() }.getOrElse { Log.w(TAG, "check failed: ${it.message}"); IDLE_MS })
+ }
+ }
+
+ /** One check, on the main thread; returns how long to wait before the next one. */
+ private fun tick(): Long {
+ if (!SponsorBlockPref.on) return IDLE_MS
+ val uri = SongPlayer.nowPlaying.value.uri
+ if (!uri.startsWith("spotify:episode:")) return IDLE_MS
+ val duration = SongPlayer.getDuration()
+ val segments = synchronized(cache) { cache[uri] }
+ if (segments == null) {
+ startLookup(uri, duration)
+ return IDLE_MS
+ }
+ val categories = SponsorBlockPref.categories()
+ // Rebuilt when the episode, its length (known after it starts) or the categories change;
+ // the same episode keeps what it skipped.
+ val key = "$duration|${categories.sorted()}|${segments.size}"
+ if (uri != trackerUri || key != trackerKey) {
+ val keep = uri == trackerUri
+ val usable = SponsorSegments.usable(segments, duration, categories)
+ tracker = if (keep && tracker?.segments == usable) tracker else SkipTracker(usable)
+ trackerUri = uri
+ trackerKey = key
+ }
+ val t = tracker ?: return IDLE_MS
+ if (t.segments.isEmpty() || !SongPlayer.isPlaying() || SongPlayer.isBuffering || SongPlayer.adPlaying) return IDLE_MS
+ val position = SongPlayer.getCurrentPosition()
+ val segment = t.due(position)
+ if (segment != null) {
+ // The episode's very end ends it: a segment up to there lands just before it.
+ val target = if (duration > 0) minOf(segment.endMs, duration - 1_000L) else segment.endMs
+ if (target > position) {
+ SongPlayer.seekTo(target)
+ justSkipped = Skipped(segment, position)
+ Logbook.log("sponsorblock: skipped ${segment.category} ${position / 1000}s -> ${target / 1000}s")
+ }
+ return CHECK_MS
+ }
+ val next = t.untilNext(position) ?: return IDLE_MS
+ return next.coerceIn(CHECK_MS, IDLE_MS)
+ }
+
+ /** Goes back to where the last skip started. */
+ internal fun undo(skipped: Skipped) {
+ SongPlayer.seekTo(skipped.from)
+ }
+
+ private fun startLookup(uri: String, durationMs: Long) {
+ if (lookup?.isActive == true && lookupUri == uri) return
+ if (uri == lookupUri && System.currentTimeMillis() - failedAt < RETRY_MS) return
+ if (com.music.spotui.data.DataSaver.active) return
+ // The length decides the YouTube match: wait for it.
+ if (durationMs <= 0) return
+ val state = Graph.currentSongState
+ val title = state.title.value
+ val show = state.album.value.ifBlank { state.singer.value }
+ lookup?.cancel()
+ lookupUri = uri
+ failedAt = 0L
+ lookup = MyspotiRuntime.scope.launch(Dispatchers.IO) {
+ val id = uri.substringAfterLast(':')
+ val found = runCatching { segmentsFor(id, title, show, durationMs) }
+ .onFailure { Log.w(TAG, "lookup failed: ${it.message}") }
+ .getOrNull()
+ withContext(Dispatchers.Main) {
+ if (found == null) failedAt = System.currentTimeMillis()
+ else synchronized(cache) { cache[uri] = found }
+ }
+ }
+ }
+
+ /** The episode's segments: Spotify's own id first, then a matching YouTube upload. Null: not asked (no network). */
+ private suspend fun segmentsFor(episodeId: String, title: String, show: String, durationMs: Long): List<SponsorSegments.Segment>? {
+ val spotify = fetch(episodeId, "Spotify") ?: return null
+ if (spotify.isNotEmpty()) {
+ Logbook.log("sponsorblock: ${spotify.size} segment(s) for the episode")
+ return spotify
+ }
+ if (title.isBlank()) return emptyList()
+ val hits = runCatching { runInterruptible { YouTubeSource.searchVideos("$show $title") } }.getOrElse {
+ Log.w(TAG, "YouTube search failed: ${it.message}"); return emptyList()
+ }
+ val best = SponsorSegments.best(title, show, durationMs, hits.map { Triple(it.name, it.uploader, it.durationSec) })
+ if (best < 0) return emptyList()
+ val videoId = YouTubeSource.videoId(hits[best].url) ?: return emptyList()
+ val youtube = fetch(videoId, "YouTube") ?: return null
+ Logbook.log("sponsorblock: no Spotify segments, YouTube upload of the same length: ${youtube.size} segment(s)")
+ return youtube
+ }
+
+ /** One hash-prefix request; the entry of [id] in it (empty: none), or null when it failed. */
+ private fun fetch(id: String, service: String): List<SponsorSegments.Segment>? {
+ val categories = SponsorSegments.ALL_CATEGORIES.joinToString(",", "[", "]") { "\"$it\"" }
+ val url = okhttp3.HttpUrl.Builder().scheme("https").host(SERVER.removePrefix("https://"))
+ .addPathSegments("api/skipSegments").addPathSegment(SponsorSegments.hashPrefix(id))
+ .addQueryParameter("service", service)
+ .addQueryParameter("categories", categories)
+ .addQueryParameter("actionTypes", "[\"skip\"]")
+ .build()
+ val request = Request.Builder().url(url).header("X-CLIENT-NAME", "Myspoti").build()
+ return YouTubeSource.http.newCall(request).execute().use { r ->
+ when {
+ // No segment for any id of that prefix.
+ r.code == 404 -> emptyList()
+ !r.isSuccessful -> null
+ else -> SponsorSegments.parse(r.body.string(), id)
+ }
+ }
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/podcast/SponsorSkipUndo.kt b/base/app/src/main/java/com/music/spotui/podcast/SponsorSkipUndo.kt
new file mode 100644
index 00000000..150d9a5a
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/podcast/SponsorSkipUndo.kt
@@ -0,0 +1,51 @@
+package com.music.spotui.podcast
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.navigationBarsPadding
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Snackbar
+import androidx.compose.material3.SnackbarDuration
+import androidx.compose.material3.SnackbarHost
+import androidx.compose.material3.SnackbarHostState
+import androidx.compose.material3.SnackbarResult
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.unit.dp
+import app.myspoti.engine.R
+import com.music.spotui.ui.theme.AppAccent
+import com.music.spotui.ui.theme.AppText
+import com.music.spotui.ui.theme.tone
+
+/** "Skipped: sponsor", with its Undo, after [SponsorSkip] jumped over a part of an episode. Drawn by the app's root over both looks. */
+@Composable
+fun SponsorSkipUndo() {
+ val context = LocalContext.current
+ val host = remember { SnackbarHostState() }
+ val skipped = SponsorSkip.justSkipped
+ LaunchedEffect(skipped) {
+ val s = skipped ?: return@LaunchedEffect
+ val what = context.getString(when (s.segment.category) {
+ SponsorSegments.SELF_PROMO -> R.string.sponsorblock_cat_selfpromo
+ SponsorSegments.INTRO, SponsorSegments.OUTRO -> R.string.sponsorblock_cat_intro_outro
+ SponsorSegments.INTERACTION -> R.string.sponsorblock_cat_interaction
+ else -> R.string.sponsorblock_cat_sponsor
+ })
+ val chosen = host.showSnackbar(
+ message = context.getString(R.string.sponsorblock_skipped, what),
+ actionLabel = context.getString(R.string.undo),
+ duration = SnackbarDuration.Short,
+ )
+ if (chosen == SnackbarResult.ActionPerformed) SponsorSkip.undo(s)
+ if (SponsorSkip.justSkipped === s) SponsorSkip.justSkipped = null
+ }
+ Box(Modifier.fillMaxSize().navigationBarsPadding().padding(bottom = 140.dp, start = 8.dp, end = 8.dp), contentAlignment = Alignment.BottomCenter) {
+ SnackbarHost(host) { data ->
+ Snackbar(snackbarData = data, containerColor = tone(0xFF282828), contentColor = AppText, actionContentColor = AppAccent)
+ }
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/ui/components/AutoMixInfo.kt b/base/app/src/main/java/com/music/spotui/ui/components/AutoMixInfo.kt
new file mode 100644
index 00000000..b2bf2c8d
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/ui/components/AutoMixInfo.kt
@@ -0,0 +1,36 @@
+package com.music.spotui.ui.components
+
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import app.myspoti.engine.R
+import com.music.spotui.automix.AutoMix
+import com.music.spotui.di.Graph
+
+/**
+ * The sentence saying why the next transition is not a mix ([AutoMix.whyNot]), for the Transitions
+ * page and "Stats for nerds"; null when it is mixed, still being analysed, or AutoMix is off.
+ * The player shows nothing more than the missing mix zone on its seek bar.
+ */
+fun autoMixReasonText(reason: AutoMix.Reason?): Int? = when (reason) {
+ null, AutoMix.Reason.Off -> null
+ AutoMix.Reason.SpotifyStream -> R.string.automix_reason_spotify
+ AutoMix.Reason.Cast -> R.string.automix_reason_cast
+ AutoMix.Reason.Podcast -> R.string.automix_reason_podcast
+ AutoMix.Reason.Album -> R.string.automix_reason_album
+ AutoMix.Reason.MobileData -> R.string.automix_reason_mobile_data
+ AutoMix.Reason.Frugal -> R.string.automix_reason_frugal
+ AutoMix.Reason.NotAnalyzed -> R.string.automix_reason_not_analyzed
+}
+
+/** The explanation shown once, the first time AutoMix is picked in Transitions (both looks). */
+object AutoMixIntro {
+ private const val KEY = "automix_intro_seen"
+ var seen by mutableStateOf(Graph.app.getSharedPreferences("myspoti_prefs", 0).getBoolean(KEY, false))
+ private set
+
+ fun markSeen() {
+ seen = true
+ Graph.app.getSharedPreferences("myspoti_prefs", 0).edit().putBoolean(KEY, true).apply()
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/ui/components/StatsForNerdsSheet.kt b/base/app/src/main/java/com/music/spotui/ui/components/StatsForNerdsSheet.kt
index 1e8613a9..81b87ddb 100644
--- a/base/app/src/main/java/com/music/spotui/ui/components/StatsForNerdsSheet.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/components/StatsForNerdsSheet.kt
@@ -23,6 +23,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.media3.common.C
import app.myspoti.engine.R
+import com.music.spotui.automix.AutoMix
import com.music.spotui.cast.CastPlayback
import com.music.spotui.data.offline.OfflineStore
import com.music.spotui.data.preferences.CrossfadePref
@@ -127,8 +128,10 @@ internal object NerdStats {
row(R.string.nerd_buffer, LocalPlayer.bufferedAheadMs()?.let { c.getString(R.string.nerd_buffer_value, it / 1000.0) })
row(R.string.nerd_state, LocalPlayer.playbackState())
rows += outputRows(c)
+ // AutoMix: the mix ahead or playing, else why the next song will not be mixed. It replaces the crossfade.
+ if (AutoMix.on) row(R.string.nerd_automix, autoMixState(c))
row(R.string.nerd_processing, listOfNotNull(
- CrossfadePref.seconds.takeIf { it > 0 }?.let { c.getString(R.string.nerd_crossfade, it) },
+ CrossfadePref.seconds.takeIf { it > 0 && !AutoMix.on }?.let { c.getString(R.string.nerd_crossfade, it) },
if (LocalPlayer.fadeProgress() < 1f) c.getString(R.string.nerd_fading) else null,
com.music.spotui.data.preferences.EqualizerPref.takeIf { it.enabled }?.let {
c.getString(R.string.nerd_equalizer, c.getString(com.music.spotui.ui.screens.eqPresetLabel(it.preset)))
@@ -139,6 +142,23 @@ internal object NerdStats {
return NerdSection(c.getString(R.string.nerd_section_exo), rows)
}
+ /** AutoMix's next transition as [LocalPlayer.mixCue] has it ("Blend at 3:12, 16 s"), or the reason there is none. */
+ private fun autoMixState(c: Context): String {
+ val cue = LocalPlayer.mixCue.value
+ if (cue != null) {
+ val style = c.getString(when (cue.style) {
+ app.myspoti.automix.MixPlan.Style.BLEND -> R.string.nerd_automix_blend
+ app.myspoti.automix.MixPlan.Style.CUT -> R.string.nerd_automix_cut
+ else -> R.string.nerd_automix_fade
+ })
+ if (cue.mixing) return c.getString(R.string.nerd_automix_mixing, style)
+ val at = cue.exitMs / 1000
+ return c.getString(R.string.nerd_automix_planned, style, "%d:%02d".format(Locale.US, at / 60, at % 60),
+ ((cue.endMs - cue.exitMs) / 1000).toInt().coerceAtLeast(1))
+ }
+ return com.music.spotui.ui.components.autoMixReasonText(AutoMix.whyNot())?.let(c::getString) ?: c.getString(R.string.nerd_automix_waiting)
+ }
+
/** The bit depth a PCM encoding says, or null (a compressed format, or none reported). */
private fun bits(c: Context, encoding: Int): String? = when (encoding) {
C.ENCODING_PCM_8BIT -> c.getString(R.string.nerd_bit_depth_value, 8)
@@ -197,6 +217,8 @@ internal object NerdStats {
}
// The level the page is given (the lowest one while it only mirrors), and what it says it plays aloud.
rows += c.getString(R.string.nerd_requested) to c.getString(streamingLabel(StreamingQuality.of(page.streamingLevel)))
+ // AutoMix on while Spotify plays: why its songs are not mixed.
+ if (!local && AutoMix.on) com.music.spotui.ui.components.autoMixReasonText(AutoMix.whyNot())?.let { rows += c.getString(R.string.nerd_automix) to c.getString(it) }
if (!local) {
val (bitrate, mime) = page.audioInfo()
rows += c.getString(R.string.nerd_page_reports) to
diff --git a/base/app/src/main/java/com/music/spotui/ui/immersive/ImmersiveTheme.kt b/base/app/src/main/java/com/music/spotui/ui/immersive/ImmersiveTheme.kt
index 89d93a63..6528ea33 100644
--- a/base/app/src/main/java/com/music/spotui/ui/immersive/ImmersiveTheme.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/immersive/ImmersiveTheme.kt
@@ -43,17 +43,34 @@ object Immersive {
val Card: Shape = RoundedCornerShape(14.dp)
val Button: Shape = RoundedCornerShape(14.dp)
- // Type (Inter).
- private val base = TextStyle(fontFamily = ImmersiveSans, color = Text)
- private val display = TextStyle(fontFamily = ImmersiveDisplay, color = Text)
- val LargeTitle = display.copy(fontSize = 32.sp, lineHeight = 38.sp, fontWeight = FontWeight.Bold)
- val Title = display.copy(fontSize = 22.sp, lineHeight = 28.sp, fontWeight = FontWeight.Bold)
- val Headline = display.copy(fontSize = 20.sp, lineHeight = 25.sp, fontWeight = FontWeight.SemiBold)
- val Body = base.copy(fontSize = 16.sp, lineHeight = 21.sp)
- val BodyStrong = Body.copy(fontWeight = FontWeight.SemiBold)
- val Subhead = base.copy(fontSize = 14.sp, lineHeight = 19.sp, color = TextSecondary)
- val Caption = base.copy(fontSize = 12.sp, lineHeight = 16.sp, color = TextSecondary)
- val Lyric = display.copy(fontSize = 30.sp, lineHeight = 36.sp, fontWeight = FontWeight.Bold)
+ // Type (Inter, or the phone's system font when chosen in the settings: AppFontPref).
+ private class Type(val sans: androidx.compose.ui.text.font.FontFamily, display: androidx.compose.ui.text.font.FontFamily) {
+ private val base = TextStyle(fontFamily = sans, color = Text)
+ private val shown = TextStyle(fontFamily = display, color = Text)
+ val largeTitle = shown.copy(fontSize = 32.sp, lineHeight = 38.sp, fontWeight = FontWeight.Bold)
+ val title = shown.copy(fontSize = 22.sp, lineHeight = 28.sp, fontWeight = FontWeight.Bold)
+ val headline = shown.copy(fontSize = 20.sp, lineHeight = 25.sp, fontWeight = FontWeight.SemiBold)
+ val body = base.copy(fontSize = 16.sp, lineHeight = 21.sp)
+ val bodyStrong = body.copy(fontWeight = FontWeight.SemiBold)
+ val subhead = base.copy(fontSize = 14.sp, lineHeight = 19.sp, color = TextSecondary)
+ val caption = base.copy(fontSize = 12.sp, lineHeight = 16.sp, color = TextSecondary)
+ val lyric = shown.copy(fontSize = 30.sp, lineHeight = 36.sp, fontWeight = FontWeight.Bold)
+ }
+ // The styles of the font in use, made again only when the font changes. Reading the font reads
+ // its setting: a screen drawn with these styles redraws when it changes.
+ @Volatile private var type: Type? = null
+ private fun type(): Type {
+ val sans = ImmersiveSans
+ return type?.takeIf { it.sans === sans } ?: Type(sans, ImmersiveDisplay).also { type = it }
+ }
+ val LargeTitle: TextStyle get() = type().largeTitle
+ val Title: TextStyle get() = type().title
+ val Headline: TextStyle get() = type().headline
+ val Body: TextStyle get() = type().body
+ val BodyStrong: TextStyle get() = type().bodyStrong
+ val Subhead: TextStyle get() = type().subhead
+ val Caption: TextStyle get() = type().caption
+ val Lyric: TextStyle get() = type().lyric
// Spacing.
val Gutter = 20.dp
diff --git a/base/app/src/main/java/com/music/spotui/ui/immersive/pages/ImmersiveSettingsScreen.kt b/base/app/src/main/java/com/music/spotui/ui/immersive/pages/ImmersiveSettingsScreen.kt
index 2468d904..54f42e01 100644
--- a/base/app/src/main/java/com/music/spotui/ui/immersive/pages/ImmersiveSettingsScreen.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/immersive/pages/ImmersiveSettingsScreen.kt
@@ -29,6 +29,7 @@ import androidx.compose.material.icons.rounded.PlayArrow
import androidx.compose.material.icons.rounded.SignalCellularAlt
import androidx.compose.material.icons.rounded.Info
import androidx.compose.material.icons.rounded.Refresh
+import androidx.compose.material.icons.rounded.Storage
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
@@ -69,7 +70,7 @@ import com.music.spotui.ui.screens.shareDiagnosticReport
import kotlinx.coroutines.launch
/** Where the Immersive Settings are: the list of categories, one category, or a choice inside it. */
-private enum class SettingsPage { Root, Playback, StreamingWifi, StreamingCell, Crossfade, Downloads, DownloadQuality, Data, Display, Look, Rotation, Language, App }
+private enum class SettingsPage { Root, Playback, StreamingWifi, StreamingCell, Crossfade, Downloads, DownloadQuality, Storage, Data, Display, Look, Rotation, Language, LyricsLanguage, App }
private val StreamingChoices = listOf(
Triple(StreamingQuality.AUTO, R.string.quality_streaming_auto, R.string.quality_streaming_auto_detail),
@@ -132,11 +133,13 @@ fun ImmersiveSettingsScreen(navController: NavController) {
SettingsPage.Crossfade -> CrossfadePage(back)
SettingsPage.Downloads -> DownloadsPage(navController, open, back)
SettingsPage.DownloadQuality -> DownloadQualityPage(back)
+ SettingsPage.Storage -> StoragePage(back)
SettingsPage.Data -> DataPage(back)
SettingsPage.Display -> DisplayPage(open, back)
SettingsPage.Look -> LookPage(back)
SettingsPage.Rotation -> RotationPage(back)
SettingsPage.Language -> LanguagePage(back)
+ SettingsPage.LyricsLanguage -> LyricsLanguagePage(back)
SettingsPage.App -> AppPage(navController, back)
}
}
@@ -152,6 +155,7 @@ private fun SettingsRoot(navController: NavController, open: (SettingsPage) -> U
immersiveGroup("root") {
row { ImmersiveGroupRow(stringResource(R.string.settings_section_playback), icon = Icons.Rounded.PlayArrow, chevron = true, onClick = { open(SettingsPage.Playback) }) }
row { ImmersiveGroupRow(stringResource(R.string.settings_section_downloads), icon = Icons.Rounded.Download, chevron = true, onClick = { open(SettingsPage.Downloads) }) }
+ row { ImmersiveGroupRow(stringResource(R.string.settings_section_storage), icon = Icons.Rounded.Storage, chevron = true, onClick = { open(SettingsPage.Storage) }) }
row { ImmersiveGroupRow(stringResource(R.string.settings_section_data), icon = Icons.Rounded.SignalCellularAlt, chevron = true, onClick = { open(SettingsPage.Data) }) }
row { ImmersiveGroupRow(stringResource(R.string.settings_section_display), icon = Icons.Rounded.Palette, chevron = true, onClick = { open(SettingsPage.Display) }) }
row { ImmersiveGroupRow(stringResource(R.string.settings_section_app), icon = Icons.Rounded.Info, chevron = true, onClick = { open(SettingsPage.App) }) }
@@ -309,7 +313,7 @@ private fun PlaybackPage(navController: NavController, open: (SettingsPage) -> U
}
}
sourcesGroup(app.myspoti.extensions.Action.AUDIO_SOURCE, navController)
- immersiveGroup("visuals") {
+ immersiveGroup("lyrics", headerRes = R.string.settings_section_lyrics) {
// Lyrics: word by word (karaoke) first, or line by line with Spotify's first.
row {
ImmersiveSwitchRow(
@@ -345,7 +349,27 @@ private fun PlaybackPage(navController: NavController, open: (SettingsPage) -> U
detail = stringResource(R.string.settings_lyrics_keep_awake_detail),
)
}
+ // The song in Latin letters under its lines, when the lyrics carry one (as in the lyrics' menu).
+ row {
+ ImmersiveSwitchRow(
+ stringResource(R.string.lyrics_romanization),
+ checked = com.music.spotui.data.preferences.LyricsRomanizationPref.on,
+ onChecked = { com.music.spotui.data.preferences.LyricsRomanizationPref.set(ctx, it) },
+ detail = stringResource(R.string.settings_lyrics_romanization_detail),
+ )
+ }
+ row {
+ val translateTo = com.music.spotui.data.preferences.getLyricTranslateLang(ctx)
+ ImmersiveGroupRow(
+ stringResource(R.string.lyrics_translation_title), detail = stringResource(R.string.lyrics_translation_detail),
+ value = if (translateTo.isEmpty()) stringResource(R.string.language_auto)
+ else com.music.spotui.data.AppLanguage.nativeName(translateTo),
+ chevron = true, onClick = { open(SettingsPage.LyricsLanguage) },
+ )
+ }
}
+ // Podcasts: SponsorBlock (SponsorBlockGroup.kt).
+ sponsorBlockGroup()
}
}
@@ -376,6 +400,14 @@ private fun CrossfadePage(back: () -> Unit) {
val transition = com.music.spotui.data.preferences.TransitionPref
val automix = com.music.spotui.automix.AutoMix
val mode = transition.mode
+ val scope = rememberCoroutineScope()
+ var intro by remember { mutableStateOf(false) }
+ // Why the song playing will not mix into the next one, while that is so.
+ val reason = if (mode == TransitionMode.AUTOMIX) com.music.spotui.ui.components.autoMixReasonText(automix.whyNot()) else null
+ var cacheRefresh by remember { mutableStateOf(0) }
+ val cacheBytes by androidx.compose.runtime.produceState<Long?>(null, cacheRefresh) {
+ value = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { automix.cacheBytes() }
+ }
ImmersivePage(title = stringResource(R.string.settings_transitions_title), onBack = back) {
immersiveGroup("mode", footerRes = R.string.settings_transitions_detail) {
for ((m, title, detail) in listOf(
@@ -385,10 +417,16 @@ private fun CrossfadePage(back: () -> Unit) {
)) {
row {
ImmersiveChoiceRow(stringResource(title), selected = mode == m, detail = stringResource(detail),
- onClick = { transition.set(ctx, m) })
+ onClick = {
+ transition.set(ctx, m)
+ if (m == TransitionMode.AUTOMIX && !com.music.spotui.ui.components.AutoMixIntro.seen) intro = true
+ })
}
}
}
+ if (reason != null) immersiveGroup("automix-now") {
+ row { ImmersiveGroupRow(stringResource(reason)) }
+ }
if (mode == TransitionMode.CROSSFADE) immersiveGroup("length", headerRes = R.string.settings_crossfade_length, footerRes = R.string.settings_crossfade_detail) {
for (v in listOf(3, 6, 9, 12)) {
row {
@@ -405,6 +443,14 @@ private fun CrossfadePage(back: () -> Unit) {
ImmersiveSwitchRow(stringResource(R.string.settings_automix_album_order), checked = automix.albumOrder,
onChecked = automix::changeAlbumOrder, detail = stringResource(R.string.settings_automix_album_order_detail))
}
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_automix_podcasts), checked = automix.mixPodcasts,
+ onChecked = automix::changeMixPodcasts, detail = stringResource(R.string.settings_automix_podcasts_detail))
+ }
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_automix_harmonic), checked = automix.harmonic,
+ onChecked = automix::changeHarmonic, detail = stringResource(R.string.settings_automix_harmonic_detail))
+ }
row {
ImmersiveSwitchRow(stringResource(R.string.settings_automix_eq), checked = automix.djEq,
onChecked = automix::changeDjEq, detail = stringResource(R.string.settings_automix_eq_detail))
@@ -413,8 +459,17 @@ private fun CrossfadePage(back: () -> Unit) {
ImmersiveSwitchRow(stringResource(R.string.settings_automix_show), checked = automix.showInPlayer,
onChecked = automix::changeShowInPlayer, detail = stringResource(R.string.settings_automix_show_detail))
}
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_automix_mobile_data), checked = automix.analyzeOnMobileData,
+ onChecked = automix::changeAnalyzeOnMobileData, detail = stringResource(R.string.settings_automix_mobile_data_detail))
+ }
+ }
+ if (mode == TransitionMode.AUTOMIX) immersiveGroup("automix-style", headerRes = R.string.settings_automix_style, footerRes = R.string.settings_automix_style_detail) {
+ listOf(R.string.settings_automix_style_blend, R.string.settings_automix_style_cut, R.string.settings_automix_style_fade).forEachIndexed { i, label ->
+ row { ImmersiveChoiceRow(stringResource(label), selected = automix.style == i, onClick = { automix.changeStyle(i) }) }
+ }
}
- if (mode == TransitionMode.AUTOMIX) immersiveGroup("automix-length", headerRes = R.string.settings_automix_length) {
+ if (mode == TransitionMode.AUTOMIX) immersiveGroup("automix-length", headerRes = R.string.settings_automix_length, footerRes = R.string.settings_automix_length_detail) {
listOf(R.string.settings_automix_length_short, R.string.settings_automix_length_auto, R.string.settings_automix_length_long).forEachIndexed { i, label ->
row { ImmersiveChoiceRow(stringResource(label), selected = automix.mixLength == i, onClick = { automix.changeMixLength(i) }) }
}
@@ -429,7 +484,34 @@ private fun CrossfadePage(back: () -> Unit) {
row { ImmersiveChoiceRow(stringResource(label), selected = automix.pulseLevel == i, onClick = { automix.changePulseLevel(i) }) }
}
}
+ // The analyses kept on the phone: dropped, the songs are analysed again when they play.
+ if (mode == TransitionMode.AUTOMIX) immersiveGroup("automix-cache") {
+ row {
+ ImmersiveGroupRow(
+ stringResource(R.string.settings_automix_cache),
+ detail = cacheBytes?.let { stringResource(R.string.settings_automix_cache_detail, android.text.format.Formatter.formatShortFileSize(ctx, it)) },
+ trailing = {
+ TextButton(enabled = (cacheBytes ?: 0L) > 0L, onClick = {
+ scope.launch {
+ kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { automix.clearCache() }
+ cacheRefresh++
+ }
+ }) { Text(stringResource(R.string.settings_automix_cache_clear), color = if ((cacheBytes ?: 0L) > 0L) Immersive.Accent else Immersive.TextSecondary) }
+ },
+ )
+ }
+ }
}
+ if (intro) ImmersiveAlertDialog(
+ onDismissRequest = { intro = false; com.music.spotui.ui.components.AutoMixIntro.markSeen() },
+ title = { Text(stringResource(R.string.settings_automix_intro_title), style = Immersive.Headline) },
+ text = { Text(stringResource(R.string.settings_automix_intro_text), style = Immersive.Subhead) },
+ confirmButton = {
+ TextButton(onClick = { intro = false; com.music.spotui.ui.components.AutoMixIntro.markSeen() }) {
+ Text(stringResource(R.string.settings_automix_intro_ok), color = Immersive.Accent)
+ }
+ },
+ )
}
// ---------------------------------------------------------------- Downloads
@@ -438,8 +520,7 @@ private fun CrossfadePage(back: () -> Unit) {
private fun DownloadsPage(navController: NavController, open: (SettingsPage) -> Unit, back: () -> Unit) {
val ctx = LocalContext.current
val quality = getDownloadQuality(ctx)
- var ask by remember { mutableStateOf(false) }
- val size = android.text.format.Formatter.formatShortFileSize(ctx, com.music.spotui.data.offline.OfflineStore.totalBytes())
+ val size =android.text.format.Formatter.formatShortFileSize(ctx, com.music.spotui.data.offline.OfflineStore.totalBytes())
// The first extension of the download order, when it announces settings here; its role quality
// takes the place of the app's (kept, and still passed to every extension as `quality`).
val registry by com.music.spotui.extensions.Extensions.registry.collectAsStateWithLifecycle()
@@ -468,6 +549,65 @@ private fun DownloadsPage(navController: NavController, open: (SettingsPage) ->
)
}
}
+ // A downloaded song's lyrics kept with it, shown without a connection.
+ immersiveGroup("lyrics") {
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_download_lyrics_title), checked = com.music.spotui.data.preferences.LyricsOfflinePref.on,
+ onChecked = { com.music.spotui.data.preferences.LyricsOfflinePref.set(ctx, it) }, detail = stringResource(R.string.settings_download_lyrics_detail))
+ }
+ }
+ // Their space and their removal: in Storage.
+ if (com.music.spotui.data.offline.OfflineStore.tracks.isNotEmpty()) immersiveGroup("storage") {
+ row {
+ ImmersiveGroupRow(
+ stringResource(R.string.settings_section_storage), detail = stringResource(R.string.downloads_size, size),
+ chevron = true, onClick = { open(SettingsPage.Storage) },
+ )
+ }
+ }
+ }
+}
+
+// ---------------------------------------------------------------- Storage
+
+/** What the app keeps on the phone: the media cache's size, the caches (emptied here) and the downloads. */
+@Composable
+private fun StoragePage(back: () -> Unit) {
+ val ctx = LocalContext.current
+ val scope = rememberCoroutineScope()
+ val storage = com.music.spotui.data.AppStorage
+ var ask by remember { mutableStateOf(false) }
+ var refresh by remember { mutableStateOf(0) }
+ var clearing by remember { mutableStateOf(false) }
+ val usage by androidx.compose.runtime.produceState<com.music.spotui.data.AppStorage.Usage?>(null, refresh) { value = storage.usage(ctx) }
+ val size = android.text.format.Formatter.formatShortFileSize(ctx, com.music.spotui.data.offline.OfflineStore.totalBytes())
+ val opened = storage.mediaCacheMbOpen
+ val labels = storage.MEDIA_CACHE_CHOICES.associateWith { com.music.spotui.ui.screens.cacheSizeLabel(it) }
+ ImmersivePage(title = stringResource(R.string.settings_section_storage), onBack = back) {
+ immersiveGroup("media", headerRes = R.string.settings_storage_media_cache,
+ footerRes = if (opened != null && opened != storage.mediaCacheMb) R.string.settings_storage_media_cache_restart else R.string.settings_storage_media_cache_detail) {
+ storage.MEDIA_CACHE_CHOICES.forEach { mb ->
+ row { ImmersiveChoiceRow(labels.getValue(mb), selected = storage.mediaCacheMb == mb, onClick = { storage.chooseMediaCacheMb(mb) }) }
+ }
+ }
+ immersiveGroup("caches") {
+ row {
+ ImmersiveGroupRow(
+ stringResource(R.string.settings_storage_clear_cache),
+ detail = usage?.let { stringResource(R.string.settings_storage_clear_cache_detail, android.text.format.Formatter.formatShortFileSize(ctx, it.caches)) },
+ enabled = !clearing,
+ onClick = {
+ clearing = true
+ scope.launch {
+ storage.clearCaches(ctx)
+ clearing = false
+ refresh++
+ android.widget.Toast.makeText(ctx, ctx.getString(R.string.settings_storage_cleared), android.widget.Toast.LENGTH_SHORT).show()
+ }
+ },
+ )
+ }
+ }
if (com.music.spotui.data.offline.OfflineStore.tracks.isNotEmpty()) immersiveGroup("remove") {
row {
ImmersiveGroupRow(
@@ -555,6 +695,7 @@ private fun DataPage(back: () -> Unit) {
@Composable
private fun DisplayPage(open: (SettingsPage) -> Unit, back: () -> Unit) {
val ctx = LocalContext.current
+ var canvasWifiOnly by remember { mutableStateOf(com.music.spotui.data.preferences.isCanvasWifiOnly(ctx)) }
val energy by app.myspoti.power.EnergySettings.state.collectAsStateWithLifecycle()
val look = com.music.spotui.data.preferences.LookPref.look
val rotation = com.music.spotui.data.preferences.OrientationPref.mode
@@ -570,6 +711,15 @@ private fun DisplayPage(open: (SettingsPage) -> Unit, back: () -> Unit) {
)
}
row { AccentRow(com.music.spotui.data.preferences.Look.IMMERSIVE) }
+ // Material You is the Classic look's: this look's colours come from the playing cover.
+ if (look == com.music.spotui.data.preferences.Look.CLASSIC && com.music.spotui.data.preferences.DynamicColorPref.available) row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_dynamic_color_title), checked = com.music.spotui.data.preferences.DynamicColorPref.on,
+ onChecked = { com.music.spotui.data.preferences.DynamicColorPref.set(ctx, it) }, detail = stringResource(R.string.settings_dynamic_color_detail))
+ }
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_system_font_title), checked = com.music.spotui.data.preferences.AppFontPref.system,
+ onChecked = { com.music.spotui.data.preferences.AppFontPref.set(ctx, it) }, detail = stringResource(R.string.settings_system_font_detail))
+ }
}
immersiveGroup("display") {
if (look == com.music.spotui.data.preferences.Look.IMMERSIVE) row {
@@ -593,6 +743,19 @@ private fun DisplayPage(open: (SettingsPage) -> Unit, back: () -> Unit) {
ImmersiveSwitchRow(stringResource(R.string.settings_amoled_theme), checked = energy.blackPreference,
onChecked = app.myspoti.power.EnergySettings::setBlackBackground, detail = stringResource(R.string.settings_amoled_theme_subtitle))
}
+ // The looping visuals, as in the Classic settings: off while the energy saver holds them.
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.settings_item_canvas_title),
+ checked = energy.canvasEnabled && !energy.policy.saverEnabled,
+ enabled = !energy.policy.saverEnabled,
+ onChecked = app.myspoti.power.EnergySettings::setCanvasEnabled,
+ detail = stringResource(if (energy.policy.saverEnabled) R.string.energy_saver_summary else R.string.video_settings_canvas_subtitle))
+ }
+ row {
+ ImmersiveSwitchRow(stringResource(R.string.canvas_wifi_only), checked = canvasWifiOnly,
+ onChecked = { canvasWifiOnly = it; com.music.spotui.data.preferences.setCanvasWifiOnly(ctx, it) },
+ detail = stringResource(R.string.canvas_wifi_only_detail))
+ }
row {
ImmersiveSwitchRow(stringResource(R.string.settings_music_video_title), checked = com.music.spotui.data.preferences.MusicVideoPref.on,
onChecked = { com.music.spotui.data.preferences.MusicVideoPref.set(ctx, it) }, detail = stringResource(R.string.settings_music_video_detail))
@@ -745,6 +908,25 @@ private fun LanguagePage(back: () -> Unit) {
}
}
+/** "Translation language" of the lyrics: the app's languages (as "App language"); Automatic is the phone's. */
+@Composable
+private fun LyricsLanguagePage(back: () -> Unit) {
+ val ctx = LocalContext.current
+ var current by remember { mutableStateOf(com.music.spotui.data.preferences.getLyricTranslateLang(ctx)) }
+ val auto = stringResource(R.string.language_auto)
+ fun label(tag: String) = if (tag == com.music.spotui.data.AppLanguage.SYSTEM) auto else com.music.spotui.data.AppLanguage.nativeName(tag)
+ ImmersivePage(title = stringResource(R.string.lyrics_translation_title), onBack = back) {
+ immersiveGroup("choices", footerRes = R.string.lyrics_translation_detail) {
+ com.music.spotui.data.AppLanguage.AVAILABLE.forEach { tag ->
+ row {
+ ImmersiveChoiceRow(label(tag), selected = tag == current,
+ onClick = { current = tag; com.music.spotui.data.preferences.setLyricTranslateLang(ctx, tag) })
+ }
+ }
+ }
+ }
+}
+
// ---------------------------------------------------------------- App
@Composable
diff --git a/base/app/src/main/java/com/music/spotui/ui/immersive/pages/SponsorBlockGroup.kt b/base/app/src/main/java/com/music/spotui/ui/immersive/pages/SponsorBlockGroup.kt
new file mode 100644
index 00000000..03c436cf
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/ui/immersive/pages/SponsorBlockGroup.kt
@@ -0,0 +1,44 @@
+package com.music.spotui.ui.immersive.pages
+
+import androidx.compose.foundation.lazy.LazyListScope
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.res.stringResource
+import app.myspoti.engine.R
+import com.music.spotui.data.preferences.SponsorBlockPref
+
+/** The Podcasts group of the Immersive settings: SponsorBlock and the parts it skips (see [com.music.spotui.podcast.SponsorSkip]). */
+internal fun LazyListScope.sponsorBlockGroup() {
+ immersiveGroup("podcasts", headerRes = R.string.settings_section_podcasts) {
+ row {
+ val ctx = LocalContext.current
+ ImmersiveSwitchRow(
+ stringResource(R.string.sponsorblock_title),
+ checked = SponsorBlockPref.on,
+ onChecked = { SponsorBlockPref.set(ctx, it) },
+ detail = stringResource(R.string.sponsorblock_detail),
+ )
+ }
+ }
+ if (SponsorBlockPref.on) immersiveGroup("sponsorblock", headerRes = R.string.sponsorblock_skip_header) {
+ row {
+ val ctx = LocalContext.current
+ ImmersiveSwitchRow(stringResource(R.string.sponsorblock_cat_sponsor), SponsorBlockPref.sponsor,
+ onChecked = { SponsorBlockPref.setSponsor(ctx, it) }, detail = stringResource(R.string.sponsorblock_cat_sponsor_detail))
+ }
+ row {
+ val ctx = LocalContext.current
+ ImmersiveSwitchRow(stringResource(R.string.sponsorblock_cat_selfpromo), SponsorBlockPref.selfPromo,
+ onChecked = { SponsorBlockPref.setSelfPromo(ctx, it) }, detail = stringResource(R.string.sponsorblock_cat_selfpromo_detail))
+ }
+ row {
+ val ctx = LocalContext.current
+ ImmersiveSwitchRow(stringResource(R.string.sponsorblock_cat_intro_outro), SponsorBlockPref.introOutro,
+ onChecked = { SponsorBlockPref.setIntroOutro(ctx, it) }, detail = stringResource(R.string.sponsorblock_cat_intro_outro_detail))
+ }
+ row {
+ val ctx = LocalContext.current
+ ImmersiveSwitchRow(stringResource(R.string.sponsorblock_cat_interaction), SponsorBlockPref.interaction,
+ onChecked = { SponsorBlockPref.setInteraction(ctx, it) }, detail = stringResource(R.string.sponsorblock_cat_interaction_detail))
+ }
+ }
+}
diff --git a/base/app/src/main/java/com/music/spotui/ui/look/Look.kt b/base/app/src/main/java/com/music/spotui/ui/look/Look.kt
index 4969cb00..f222e0ba 100644
--- a/base/app/src/main/java/com/music/spotui/ui/look/Look.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/look/Look.kt
@@ -40,11 +40,14 @@ private fun inter(weight: Int, opticalSize: Float) = Font(
private val weights = listOf(400, 500, 600, 700, 800)
-/** Body text, captions, buttons. */
-val ImmersiveSans = FontFamily(weights.map { inter(it, 14f) })
+private val interText = FontFamily(weights.map { inter(it, 14f) })
+private val interDisplay = FontFamily(weights.map { inter(it, 32f) })
-/** Titles, the player's title and the lyrics (20sp and up). */
-val ImmersiveDisplay = FontFamily(weights.map { inter(it, 32f) })
+/** Body text, captions, buttons (the phone's system font when chosen in the settings: AppFontPref). */
+val ImmersiveSans: FontFamily get() = if (com.music.spotui.data.preferences.AppFontPref.system) FontFamily.Default else interText
+
+/** Titles, the player's title and the lyrics (20sp and up); the system font as [ImmersiveSans]. */
+val ImmersiveDisplay: FontFamily get() = if (com.music.spotui.data.preferences.AppFontPref.system) FontFamily.Default else interDisplay
/**
* The phone's "Remove animations" setting, read once at the root (see App) for both looks.
diff --git a/base/app/src/main/java/com/music/spotui/ui/screens/SettingsScreen.kt b/base/app/src/main/java/com/music/spotui/ui/screens/SettingsScreen.kt
index 61e14def..da44cb85 100644
--- a/base/app/src/main/java/com/music/spotui/ui/screens/SettingsScreen.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/screens/SettingsScreen.kt
@@ -149,7 +149,38 @@ fun SettingsScreen(navController: NavController) {
checked = headsetSkip,
onChecked = { headsetSkip = it; app.myspoti.host.android.PlaybackService.setSkipsOnEpisodes(ctx, it) },
)
+ // Songs an extension streams, played by Spotify too (unheard): counted there, seen by Connect.
+ if (com.music.spotui.extensions.Extensions.sources(app.myspoti.extensions.Action.AUDIO_SOURCE).isNotEmpty())
+ OptionRow(
+ label = stringResource(R.string.settings_connect_mirror_title),
+ detail = stringResource(R.string.settings_connect_mirror_detail),
+ checked = com.music.spotui.data.preferences.ConnectMirrorPref.on,
+ onChecked = { com.music.spotui.data.preferences.ConnectMirrorPref.set(ctx, it) },
+ )
+ // Live Radio: adds the pinned Library row under Local Files (see com.music.spotui.radio).
+ OptionRow(
+ label = stringResource(R.string.live_radio_settings_title),
+ detail = stringResource(R.string.live_radio_settings_detail),
+ checked = com.music.spotui.radio.RadioFeaturePref.on,
+ onChecked = { com.music.spotui.radio.RadioFeaturePref.set(ctx, it) },
+ )
+ // Downloaded songs, played from their files online, played by Spotify too (unheard), as an extension's.
+ OptionRow(
+ label = stringResource(R.string.settings_download_sync_title),
+ detail = stringResource(R.string.settings_download_sync_detail),
+ checked = com.music.spotui.data.preferences.DownloadSyncPref.on,
+ onChecked = { com.music.spotui.data.preferences.DownloadSyncPref.set(ctx, it) },
+ )
+ // Songs marked "Not interested": skipped by lists, listed here to be shown again.
+ Column(
+ Modifier.fillMaxWidth().clickable { navController.navigate(com.music.spotui.ui.navigation.Routes.HiddenSongs.route) }
+ .padding(horizontal = 20.dp, vertical = 10.dp),
+ ) {
+ Text(stringResource(R.string.hidden_songs_title), color = AppText, fontSize = 16.sp)
+ Text(stringResource(R.string.hidden_songs_detail), color = AppMuted, fontSize = 12.sp)
+ }
// Lyrics: word by word (karaoke) first, or line by line with Spotify's first.
+ Section(R.string.settings_section_lyrics)
var wordSync by remember { mutableStateOf(com.music.spotui.data.preferences.isLyricsWordSync(ctx)) }
OptionRow(
label = stringResource(R.string.lyrics_word_sync_title),
@@ -182,38 +213,18 @@ fun SettingsScreen(navController: NavController) {
checked = com.music.spotui.data.preferences.LyricsKeepAwakePref.on,
onChecked = { com.music.spotui.data.preferences.LyricsKeepAwakePref.set(ctx, it) },
)
- // Songs an extension streams, played by Spotify too (unheard): counted there, seen by Connect.
- if (com.music.spotui.extensions.Extensions.sources(app.myspoti.extensions.Action.AUDIO_SOURCE).isNotEmpty())
- OptionRow(
- label = stringResource(R.string.settings_connect_mirror_title),
- detail = stringResource(R.string.settings_connect_mirror_detail),
- checked = com.music.spotui.data.preferences.ConnectMirrorPref.on,
- onChecked = { com.music.spotui.data.preferences.ConnectMirrorPref.set(ctx, it) },
- )
- // Live Radio: adds the pinned Library row under Local Files (see com.music.spotui.radio).
- OptionRow(
- label = stringResource(R.string.live_radio_settings_title),
- detail = stringResource(R.string.live_radio_settings_detail),
- checked = com.music.spotui.radio.RadioFeaturePref.on,
- onChecked = { com.music.spotui.radio.RadioFeaturePref.set(ctx, it) },
- )
- // Downloaded songs, played from their files online, played by Spotify too (unheard), as an extension's.
+ // The song in Latin letters under its lines, when the lyrics carry one (as in the lyrics' menu).
OptionRow(
- label = stringResource(R.string.settings_download_sync_title),
- detail = stringResource(R.string.settings_download_sync_detail),
- checked = com.music.spotui.data.preferences.DownloadSyncPref.on,
- onChecked = { com.music.spotui.data.preferences.DownloadSyncPref.set(ctx, it) },
+ label = stringResource(R.string.lyrics_romanization),
+ detail = stringResource(R.string.settings_lyrics_romanization_detail),
+ checked = com.music.spotui.data.preferences.LyricsRomanizationPref.on,
+ onChecked = { com.music.spotui.data.preferences.LyricsRomanizationPref.set(ctx, it) },
)
- // Songs marked "Not interested": skipped by lists, listed here to be shown again.
- Column(
- Modifier.fillMaxWidth().clickable { navController.navigate(com.music.spotui.ui.navigation.Routes.HiddenSongs.route) }
- .padding(horizontal = 20.dp, vertical = 10.dp),
- ) {
- Text(stringResource(R.string.hidden_songs_title), color = AppText, fontSize = 16.sp)
- Text(stringResource(R.string.hidden_songs_detail), color = AppMuted, fontSize = 12.sp)
- }
+ LyricsTranslationRow()
Divider()
SourcesBlock(app.myspoti.extensions.Action.AUDIO_SOURCE, navController)
+ // Podcasts: SponsorBlock (SponsorBlockSettings.kt).
+ SponsorBlockSettings()
Section(R.string.settings_section_data)
OptionRow(
@@ -273,6 +284,16 @@ fun SettingsScreen(navController: NavController) {
color = AppMuted, fontSize = 12.sp,
)
}
+ // A downloaded song's lyrics kept with it, shown without a connection.
+ OptionRow(
+ label = stringResource(R.string.settings_download_lyrics_title),
+ detail = stringResource(R.string.settings_download_lyrics_detail),
+ checked = com.music.spotui.data.preferences.LyricsOfflinePref.on,
+ onChecked = { com.music.spotui.data.preferences.LyricsOfflinePref.set(ctx, it) },
+ )
+ // What the app keeps on the phone: the caches (emptied here) and the downloads.
+ Section(R.string.settings_section_storage)
+ StorageRows()
if (com.music.spotui.data.offline.OfflineStore.tracks.isNotEmpty()) RemoveDownloadsRow()
}
if (tab == 2) {
@@ -321,7 +342,20 @@ fun SettingsScreen(navController: NavController) {
checked = com.music.spotui.data.preferences.HideDjPref.on,
onChecked = { com.music.spotui.data.preferences.HideDjPref.set(ctx, it) },
)
- AccentRow(com.music.spotui.data.preferences.Look.CLASSIC)
+ // Material You: the wallpaper's accent (Android 12+), in place of the one picked below.
+ if (com.music.spotui.data.preferences.DynamicColorPref.available) OptionRow(
+ label = stringResource(R.string.settings_dynamic_color_title),
+ detail = stringResource(R.string.settings_dynamic_color_detail),
+ checked = com.music.spotui.data.preferences.DynamicColorPref.on,
+ onChecked = { com.music.spotui.data.preferences.DynamicColorPref.set(ctx, it) },
+ )
+ if (!com.music.spotui.data.preferences.DynamicColorPref.active) AccentRow(com.music.spotui.data.preferences.Look.CLASSIC)
+ OptionRow(
+ label = stringResource(R.string.settings_system_font_title),
+ detail = stringResource(R.string.settings_system_font_detail),
+ checked = com.music.spotui.data.preferences.AppFontPref.system,
+ onChecked = { com.music.spotui.data.preferences.AppFontPref.set(ctx, it) },
+ )
LookRow()
OrientationRow()
LanguageRow()
@@ -360,8 +394,7 @@ fun SettingsScreen(navController: NavController) {
Text(stringResource(R.string.restart_player_detail), color = AppMuted, fontSize = 12.sp)
}
// The report a tester hands us. The engine's log is otherwise reachable only through
- // adb logcat, which the person reporting the bug cannot run: the label is a literal
- // rather than a string resource so this change stays out of the shared string files.
+ // adb logcat, which the person reporting the bug cannot run.
Column(
Modifier.fillMaxWidth().clickable {
val file = runCatching { app.myspoti.host.android.Logbook.export(ctx) }.getOrNull()
@@ -496,6 +529,7 @@ private fun TransitionsRow() {
val transition = com.music.spotui.data.preferences.TransitionPref
val automix = com.music.spotui.automix.AutoMix
val mode = transition.mode
+ var intro by remember { mutableStateOf(false) }
@Composable
fun Chip(label: String, selected: Boolean, onClick: () -> Unit) = Text(
label,
@@ -518,7 +552,10 @@ private fun TransitionsRow() {
) {
Chip(stringResource(R.string.settings_crossfade_off), mode == TransitionMode.OFF) { transition.set(ctx, TransitionMode.OFF) }
Chip(stringResource(R.string.settings_crossfade_title), mode == TransitionMode.CROSSFADE) { transition.set(ctx, TransitionMode.CROSSFADE) }
- Chip(stringResource(R.string.settings_automix_title), mode == TransitionMode.AUTOMIX) { transition.set(ctx, TransitionMode.AUTOMIX) }
+ Chip(stringResource(R.string.settings_automix_title), mode == TransitionMode.AUTOMIX) {
+ transition.set(ctx, TransitionMode.AUTOMIX)
+ if (!com.music.spotui.ui.components.AutoMixIntro.seen) intro = true
+ }
}
Text(
stringResource(when (mode) {
@@ -529,6 +566,16 @@ private fun TransitionsRow() {
color = AppMuted, fontSize = 12.sp,
modifier = Modifier.padding(top = 8.dp),
)
+ // The long explanation of AutoMix, as the Immersive page gives it under the choice.
+ if (mode == TransitionMode.AUTOMIX) Text(
+ stringResource(R.string.settings_automix_detail),
+ color = AppMuted, fontSize = 12.sp,
+ modifier = Modifier.padding(top = 8.dp),
+ )
+ // Why the song playing will not mix into the next one, while that is so.
+ if (mode == TransitionMode.AUTOMIX) com.music.spotui.ui.components.autoMixReasonText(automix.whyNot())?.let {
+ Text(stringResource(it), color = com.music.spotui.ui.theme.AppAccent, fontSize = 12.sp, modifier = Modifier.padding(top = 8.dp))
+ }
if (mode == TransitionMode.CROSSFADE) Row(
horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(8.dp),
modifier = Modifier.padding(top = 10.dp),
@@ -541,20 +588,32 @@ private fun TransitionsRow() {
checked = automix.mixOnNext, onChecked = automix::changeMixOnNext)
OptionRow(stringResource(R.string.settings_automix_album_order), stringResource(R.string.settings_automix_album_order_detail),
checked = automix.albumOrder, onChecked = automix::changeAlbumOrder)
+ OptionRow(stringResource(R.string.settings_automix_podcasts), stringResource(R.string.settings_automix_podcasts_detail),
+ checked = automix.mixPodcasts, onChecked = automix::changeMixPodcasts)
+ OptionRow(stringResource(R.string.settings_automix_harmonic), stringResource(R.string.settings_automix_harmonic_detail),
+ checked = automix.harmonic, onChecked = automix::changeHarmonic)
OptionRow(stringResource(R.string.settings_automix_eq), stringResource(R.string.settings_automix_eq_detail),
checked = automix.djEq, onChecked = automix::changeDjEq)
OptionRow(stringResource(R.string.settings_automix_show), stringResource(R.string.settings_automix_show_detail),
checked = automix.showInPlayer, onChecked = automix::changeShowInPlayer)
+ OptionRow(stringResource(R.string.settings_automix_mobile_data), stringResource(R.string.settings_automix_mobile_data_detail),
+ checked = automix.analyzeOnMobileData, onChecked = automix::changeAnalyzeOnMobileData)
+ // Chips wrap: the style's labels do not fit one line in every language.
+ @OptIn(androidx.compose.foundation.layout.ExperimentalLayoutApi::class)
@Composable
fun Choices(title: Int, detail: Int?, labels: List<Int>, selected: Int, pick: (Int) -> Unit) =
androidx.compose.foundation.layout.Column(Modifier.fillMaxWidth().padding(horizontal = 20.dp, vertical = 10.dp)) {
Text(stringResource(title), color = AppText, fontSize = 16.sp)
detail?.let { Text(stringResource(it), color = AppMuted, fontSize = 12.sp, modifier = Modifier.padding(top = 2.dp)) }
- Row(horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(8.dp), modifier = Modifier.padding(top = 10.dp)) {
+ androidx.compose.foundation.layout.FlowRow(horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(8.dp),
+ verticalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(8.dp), modifier = Modifier.padding(top = 10.dp)) {
labels.forEachIndexed { i, l -> Chip(stringResource(l), selected == i) { pick(i) } }
}
}
- Choices(R.string.settings_automix_length, null,
+ Choices(R.string.settings_automix_style, R.string.settings_automix_style_detail,
+ listOf(R.string.settings_automix_style_blend, R.string.settings_automix_style_cut, R.string.settings_automix_style_fade),
+ automix.style, automix::changeStyle)
+ Choices(R.string.settings_automix_length, R.string.settings_automix_length_detail,
listOf(R.string.settings_automix_length_short, R.string.settings_automix_length_auto, R.string.settings_automix_length_long),
automix.mixLength, automix::changeMixLength)
Choices(R.string.settings_automix_tempo, R.string.settings_automix_tempo_detail,
@@ -563,6 +622,47 @@ private fun TransitionsRow() {
if (automix.showInPlayer) Choices(R.string.settings_automix_pulse, null,
listOf(R.string.settings_crossfade_off, R.string.settings_automix_pulse_subtle, R.string.settings_automix_pulse_strong),
automix.pulseLevel, automix::changePulseLevel)
+ AutoMixCacheRow()
+ }
+ if (intro) androidx.compose.material3.AlertDialog(
+ onDismissRequest = { intro = false; com.music.spotui.ui.components.AutoMixIntro.markSeen() },
+ containerColor = tone(0xFF282828),
+ title = { Text(stringResource(R.string.settings_automix_intro_title), color = AppText) },
+ text = { Text(stringResource(R.string.settings_automix_intro_text), color = AppMuted) },
+ confirmButton = {
+ androidx.compose.material3.TextButton(onClick = { intro = false; com.music.spotui.ui.components.AutoMixIntro.markSeen() }) {
+ Text(stringResource(R.string.settings_automix_intro_ok), color = com.music.spotui.ui.theme.AppAccent)
+ }
+ },
+ )
+}
+
+/** The AutoMix analyses kept on the phone: their space, and a button that drops them (analysed again when played). */
+@Composable
+private fun AutoMixCacheRow() {
+ val ctx = androidx.compose.ui.platform.LocalContext.current
+ val scope = androidx.compose.runtime.rememberCoroutineScope()
+ var refresh by remember { mutableStateOf(0) }
+ val bytes by androidx.compose.runtime.produceState<Long?>(null, refresh) {
+ value = kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { com.music.spotui.automix.AutoMix.cacheBytes() }
+ }
+ Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(start = 20.dp, end = 12.dp, top = 10.dp, bottom = 10.dp)) {
+ androidx.compose.foundation.layout.Column(Modifier.weight(1f)) {
+ Text(stringResource(R.string.settings_automix_cache), color = AppText, fontSize = 16.sp)
+ Text(
+ bytes?.let { stringResource(R.string.settings_automix_cache_detail, android.text.format.Formatter.formatShortFileSize(ctx, it)) }.orEmpty(),
+ color = AppMuted, fontSize = 12.sp,
+ )
+ }
+ androidx.compose.material3.TextButton(
+ enabled = (bytes ?: 0L) > 0L,
+ onClick = {
+ scope.launch {
+ kotlinx.coroutines.withContext(kotlinx.coroutines.Dispatchers.IO) { com.music.spotui.automix.AutoMix.clearCache() }
+ refresh++
+ }
+ },
+ ) { Text(stringResource(R.string.settings_automix_cache_clear), color = com.music.spotui.ui.theme.AppAccent) }
}
}
@@ -646,6 +746,110 @@ private fun LanguageRow() {
}
}
+/**
+ * "Translation language": the language lyrics are translated into, picked from the app's languages
+ * (the same list and names as "App language"); Automatic is the phone's language.
+ */
+@OptIn(androidx.compose.material3.ExperimentalMaterial3Api::class)
+@Composable
+private fun LyricsTranslationRow() {
+ val ctx = androidx.compose.ui.platform.LocalContext.current
+ var current by remember { mutableStateOf(com.music.spotui.data.preferences.getLyricTranslateLang(ctx)) }
+ var picking by remember { androidx.compose.runtime.mutableStateOf(false) }
+ val auto = stringResource(R.string.language_auto)
+ fun label(tag: String) = if (tag == com.music.spotui.data.AppLanguage.SYSTEM) auto else com.music.spotui.data.AppLanguage.nativeName(tag)
+ androidx.compose.foundation.layout.Column(
+ Modifier.fillMaxWidth().clickable { picking = true }.padding(horizontal = 20.dp, vertical = 10.dp),
+ ) {
+ Text(stringResource(R.string.lyrics_translation_title), color = AppText, fontSize = 16.sp)
+ Text(label(current), color = AppMuted, fontSize = 12.sp)
+ }
+ if (picking) androidx.compose.material3.ModalBottomSheet(
+ onDismissRequest = { picking = false },
+ containerColor = tone(0xFF282828),
+ ) {
+ androidx.compose.foundation.lazy.LazyColumn(Modifier.fillMaxWidth().padding(bottom = 16.dp)) {
+ item {
+ Text(stringResource(R.string.lyrics_translation_title), color = AppText, fontSize = 18.sp,
+ fontWeight = FontWeight.Bold, modifier = Modifier.padding(horizontal = 20.dp, vertical = 8.dp))
+ Text(stringResource(R.string.lyrics_translation_detail), color = AppMuted, fontSize = 12.sp,
+ modifier = Modifier.padding(start = 20.dp, end = 20.dp, bottom = 8.dp))
+ }
+ items(com.music.spotui.data.AppLanguage.AVAILABLE.size) { i ->
+ val tag = com.music.spotui.data.AppLanguage.AVAILABLE[i]
+ val selected = tag == current
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier = Modifier.fillMaxWidth().heightIn(min = 52.dp).clickable {
+ picking = false
+ if (!selected) {
+ current = tag
+ com.music.spotui.data.preferences.setLyricTranslateLang(ctx, tag)
+ }
+ }.padding(horizontal = 20.dp, vertical = 8.dp),
+ ) {
+ Text(label(tag), color = if (selected) com.music.spotui.ui.theme.AppAccent else AppText, fontSize = 16.sp, modifier = Modifier.weight(1f))
+ if (selected) androidx.compose.material3.Icon(androidx.compose.material.icons.Icons.Default.Check, null, tint = com.music.spotui.ui.theme.AppAccent)
+ }
+ }
+ }
+ }
+}
+
+/** A size in MB as the storage rows show it ("256 MB", "1 GB"). */
+@Composable
+internal fun cacheSizeLabel(mb: Int): String =
+ if (mb >= 1024) stringResource(R.string.settings_storage_gb, mb / 1024) else stringResource(R.string.settings_storage_mb, mb)
+
+/** Storage: the media cache's size (applied when the app starts again) and the caches' space, with a button that empties them. */
+@Composable
+private fun StorageRows() {
+ val ctx = androidx.compose.ui.platform.LocalContext.current
+ val scope = androidx.compose.runtime.rememberCoroutineScope()
+ val storage = com.music.spotui.data.AppStorage
+ var refresh by remember { mutableStateOf(0) }
+ var clearing by remember { mutableStateOf(false) }
+ val usage by androidx.compose.runtime.produceState<com.music.spotui.data.AppStorage.Usage?>(null, refresh) { value = storage.usage(ctx) }
+ androidx.compose.foundation.layout.Column(Modifier.fillMaxWidth().padding(horizontal = 20.dp, vertical = 10.dp)) {
+ Text(stringResource(R.string.settings_storage_media_cache), color = AppText, fontSize = 16.sp)
+ val open = storage.mediaCacheMbOpen
+ Text(
+ stringResource(if (open != null && open != storage.mediaCacheMb) R.string.settings_storage_media_cache_restart else R.string.settings_storage_media_cache_detail),
+ color = AppMuted, fontSize = 12.sp, modifier = Modifier.padding(top = 2.dp),
+ )
+ Row(horizontalArrangement = androidx.compose.foundation.layout.Arrangement.spacedBy(8.dp), modifier = Modifier.padding(top = 10.dp)) {
+ for (mb in storage.MEDIA_CACHE_CHOICES) {
+ val selected = storage.mediaCacheMb == mb
+ Text(
+ cacheSizeLabel(mb),
+ color = if (selected) Color.Black else AppText, fontSize = 14.sp,
+ modifier = Modifier.clip(androidx.compose.foundation.shape.RoundedCornerShape(50))
+ .background(if (selected) com.music.spotui.ui.theme.AppAccent else tone(0xFF2A2A2A))
+ .clickable { storage.chooseMediaCacheMb(mb) }
+ .padding(horizontal = 14.dp, vertical = 8.dp),
+ )
+ }
+ }
+ }
+ androidx.compose.foundation.layout.Column(
+ Modifier.fillMaxWidth().clickable(enabled = !clearing) {
+ clearing = true
+ scope.launch {
+ storage.clearCaches(ctx)
+ clearing = false
+ refresh++
+ android.widget.Toast.makeText(ctx, ctx.getString(R.string.settings_storage_cleared), android.widget.Toast.LENGTH_SHORT).show()
+ }
+ }.padding(horizontal = 20.dp, vertical = 10.dp),
+ ) {
+ Text(stringResource(R.string.settings_storage_clear_cache), color = AppText, fontSize = 16.sp)
+ Text(
+ usage?.let { stringResource(R.string.settings_storage_clear_cache_detail, android.text.format.Formatter.formatShortFileSize(ctx, it.caches)) }.orEmpty(),
+ color = AppMuted, fontSize = 12.sp,
+ )
+ }
+}
+
/** "Remove all downloads", with the space they take; asks first, like the official app. */
@Composable
private fun RemoveDownloadsRow() {
diff --git a/base/app/src/main/java/com/music/spotui/ui/screens/SponsorBlockSettings.kt b/base/app/src/main/java/com/music/spotui/ui/screens/SponsorBlockSettings.kt
new file mode 100644
index 00000000..3edf00df
--- /dev/null
+++ b/base/app/src/main/java/com/music/spotui/ui/screens/SponsorBlockSettings.kt
@@ -0,0 +1,29 @@
+package com.music.spotui.ui.screens
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.platform.LocalContext
+import androidx.compose.ui.res.stringResource
+import app.myspoti.engine.R
+import com.music.spotui.data.preferences.SponsorBlockPref
+
+/** The Podcasts group of the settings: SponsorBlock and the parts it skips (see [com.music.spotui.podcast.SponsorSkip]). */
+@Composable
+internal fun SponsorBlockSettings() {
+ val ctx = LocalContext.current
+ Section(R.string.settings_section_podcasts)
+ OptionRow(
+ label = stringResource(R.string.sponsorblock_title),
+ detail = stringResource(R.string.sponsorblock_detail),
+ checked = SponsorBlockPref.on,
+ onChecked = { SponsorBlockPref.set(ctx, it) },
+ )
+ if (!SponsorBlockPref.on) return
+ OptionRow(stringResource(R.string.sponsorblock_cat_sponsor), stringResource(R.string.sponsorblock_cat_sponsor_detail),
+ SponsorBlockPref.sponsor, onChecked = { SponsorBlockPref.setSponsor(ctx, it) })
+ OptionRow(stringResource(R.string.sponsorblock_cat_selfpromo), stringResource(R.string.sponsorblock_cat_selfpromo_detail),
+ SponsorBlockPref.selfPromo, onChecked = { SponsorBlockPref.setSelfPromo(ctx, it) })
+ OptionRow(stringResource(R.string.sponsorblock_cat_intro_outro), stringResource(R.string.sponsorblock_cat_intro_outro_detail),
+ SponsorBlockPref.introOutro, onChecked = { SponsorBlockPref.setIntroOutro(ctx, it) })
+ OptionRow(stringResource(R.string.sponsorblock_cat_interaction), stringResource(R.string.sponsorblock_cat_interaction_detail),
+ SponsorBlockPref.interaction, onChecked = { SponsorBlockPref.setInteraction(ctx, it) })
+}
diff --git a/base/app/src/main/java/com/music/spotui/ui/theme/Color.kt b/base/app/src/main/java/com/music/spotui/ui/theme/Color.kt
index 6f2090ed..31d755f4 100644
--- a/base/app/src/main/java/com/music/spotui/ui/theme/Color.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/theme/Color.kt
@@ -6,9 +6,10 @@ import androidx.compose.ui.graphics.lerp
val AppBackground: Color get() =
if (app.myspoti.power.EnergySettings.oledBlack) Color.Black else Color(0xFF121212)
val GridBackground: Color get() = tone(0xFF2A2A2A)
-/** The accent (Spotify green, or the colour a supporter chose). */
+/** The accent (Spotify green, the colour chosen in the settings, or the wallpaper's: see DynamicColorPref). */
val AppPalette: Color get() = AppAccent
-val AppAccent: Color get() = com.music.spotui.data.api.SupportReminder.accentColor
+val AppAccent: Color get() =
+ com.music.spotui.data.preferences.DynamicColorPref.accent() ?: com.music.spotui.data.api.SupportReminder.accentColor
/** Primary text and icons. */
val AppText: Color = Color.White
diff --git a/base/app/src/main/java/com/music/spotui/ui/theme/Theme.kt b/base/app/src/main/java/com/music/spotui/ui/theme/Theme.kt
index af886978..2c97ff86 100644
--- a/base/app/src/main/java/com/music/spotui/ui/theme/Theme.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/theme/Theme.kt
@@ -64,6 +64,9 @@ fun SpotuiTheme(
androidx.compose.runtime.LaunchedEffect(policy.videoMaxHeight, policy.allowBackgroundLookups) {
com.music.spotui.video.MusicVideoController.onEnergyPolicyChanged()
}
+ // A new wallpaper recreates the activity: its accent is read again (Material You, see DynamicColorPref).
+ val configuration = androidx.compose.ui.platform.LocalConfiguration.current
+ androidx.compose.runtime.remember(configuration) { com.music.spotui.data.preferences.DynamicColorPref.refresh() }
// Dark only, like Spotify: a saved choice from the withdrawn light palette is ignored.
val visualScheme: ColorScheme = spotifyColorScheme(AppAccent)
val view = LocalView.current
diff --git a/base/app/src/main/java/com/music/spotui/ui/theme/Type.kt b/base/app/src/main/java/com/music/spotui/ui/theme/Type.kt
index ba381757..dd59f03d 100644
--- a/base/app/src/main/java/com/music/spotui/ui/theme/Type.kt
+++ b/base/app/src/main/java/com/music/spotui/ui/theme/Type.kt
@@ -25,23 +25,32 @@ private fun sans(weight: Int) = Font(
),
)
-val AppSans = FontFamily(sans(400), sans(500), sans(600), sans(700), sans(800), sans(900))
+private val ownSans = FontFamily(sans(400), sans(500), sans(600), sans(700), sans(800), sans(900))
+
+/** The app's font: Manrope, or the phone's system font when chosen in the settings (AppFontPref). */
+val AppSans: FontFamily get() = if (com.music.spotui.data.preferences.AppFontPref.system) FontFamily.Default else ownSans
/** Headings: the same family, heavier cuts. */
-val AppSansTitle = AppSans
+val AppSansTitle: FontFamily get() = AppSans
// Kept as an alias so existing references (Theme.kt etc.) don't break.
-val Montserrat = AppSans
-
-private val base = TextStyle(fontFamily = AppSans)
-private val title = TextStyle(fontFamily = AppSansTitle, fontWeight = FontWeight.Bold)
-
-val Typography = Typography(
- displayLarge = title, displayMedium = title, displaySmall = title,
- headlineLarge = title, headlineMedium = title, headlineSmall = title,
- titleLarge = base.copy(fontWeight = FontWeight.Bold),
- titleMedium = base.copy(fontWeight = FontWeight.Bold),
- titleSmall = base.copy(fontWeight = FontWeight.Bold),
- bodyLarge = base.copy(fontSize = 16.sp, lineHeight = 24.sp),
- bodyMedium = base, bodySmall = base,
- labelLarge = base, labelMedium = base, labelSmall = base,
-)
+val Montserrat: FontFamily get() = AppSans
+
+private fun typography(family: FontFamily): Typography {
+ val base = TextStyle(fontFamily = family)
+ val title = TextStyle(fontFamily = family, fontWeight = FontWeight.Bold)
+ return Typography(
+ displayLarge = title, displayMedium = title, displaySmall = title,
+ headlineLarge = title, headlineMedium = title, headlineSmall = title,
+ titleLarge = base.copy(fontWeight = FontWeight.Bold),
+ titleMedium = base.copy(fontWeight = FontWeight.Bold),
+ titleSmall = base.copy(fontWeight = FontWeight.Bold),
+ bodyLarge = base.copy(fontSize = 16.sp, lineHeight = 24.sp),
+ bodyMedium = base, bodySmall = base,
+ labelLarge = base, labelMedium = base, labelSmall = base,
+ )
+}
+
+private val ownTypography by lazy { typography(ownSans) }
+private val systemTypography by lazy { typography(FontFamily.Default) }
+
+val Typography: Typography get() = if (com.music.spotui.data.preferences.AppFontPref.system) systemTypography else ownTypography
diff --git a/base/app/src/main/java/com/music/spotui/video/YouTubeSource.kt b/base/app/src/main/java/com/music/spotui/video/YouTubeSource.kt
index c99ddd93..fcb3f460 100644
--- a/base/app/src/main/java/com/music/spotui/video/YouTubeSource.kt
+++ b/base/app/src/main/java/com/music/spotui/video/YouTubeSource.kt
@@ -117,6 +117,9 @@ object YouTubeSource {
}
}
+ /** Plain YouTube videos for [query] (a podcast episode's upload, for SponsorBlock); blocking, call off the main thread. */
+ fun searchVideos(query: String): List<Hit> = search(query, YoutubeSearchQueryHandlerFactory.VIDEOS)
+
private fun elided(s: String) = s.replace(Regex("""(?<=\p{L})['’](?=\p{L})"""), "")
/** The YouTube Music "song" of the track (Topic / art track), duration within 3 s. */
diff --git a/base/app/src/main/res/values-de/myspoti_strings.xml b/base/app/src/main/res/values-de/myspoti_strings.xml
index 106a8aeb..26cfc5b9 100644
--- a/base/app/src/main/res/values-de/myspoti_strings.xml
+++ b/base/app/src/main/res/values-de/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Verifizierter Künstler</string>
<string name="lyrics_share">Songtext teilen</string>
<string name="lyrics_extra_title">Weitere Songtext-Quellen</string>
+ <string name="settings_section_lyrics">Songtexte</string>
+ <string name="settings_lyrics_romanization_detail">Unter den Zeilen der Song in lateinischen Buchstaben, wenn der Songtext sie hat</string>
+ <string name="lyrics_translation_title">Übersetzungssprache</string>
+ <string name="lyrics_translation_detail">Die Sprache, in die Songtexte übersetzt werden. Automatisch: die Sprache des Telefons.</string>
<string name="lyrics_extra_summary">NetEase und Genius, wenn Spotify keinen Songtext hat</string>
<string name="lyrics_reload">Songtext neu laden</string>
<string name="lyrics_select_hint">Tippe auf Zeilen, um auszuwählen, was du teilen möchtest</string>
@@ -666,6 +670,18 @@
<string name="settings_player_volume_detail">Der Lautstärkeregler unter den Tasten. Aus: Die Lautstärketasten des Telefons regeln sie weiterhin.</string>
<string name="settings_lyrics_keep_awake_title">Bildschirm bei Songtexten anlassen</string>
<string name="settings_lyrics_keep_awake_detail">Solange der Songtext offen ist, schaltet sich der Bildschirm nicht von selbst aus.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Überspringt Sponsorenhinweise und andere Teile von Podcastfolgen, die die SponsorBlock-Community markiert hat. Fragt sponsor.ajay.app nach der laufenden Folge (und bei Bedarf YouTube, um ihren Upload zu finden); nichts über dich oder dein Konto wird gesendet.</string>
+ <string name="sponsorblock_skip_header">Zu überspringende Teile</string>
+ <string name="sponsorblock_cat_sponsor">Sponsoren</string>
+ <string name="sponsorblock_cat_sponsor_detail">Bezahlte Werbung und Werbeeinschübe</string>
+ <string name="sponsorblock_cat_selfpromo">Eigenwerbung</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Merch der Sendung, Patreon, andere Sendungen</string>
+ <string name="sponsorblock_cat_intro_outro">Intro und Outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Anfangs- und Schlussmusik, Abspann</string>
+ <string name="sponsorblock_cat_interaction">Erinnerungen</string>
+ <string name="sponsorblock_cat_interaction_detail">Aufrufe zum Folgen, Bewerten oder Abonnieren</string>
+ <string name="sponsorblock_skipped">Übersprungen: %1$s</string>
<string name="spatial_title">Raumklang</string>
<string name="spatial_enable">Stereobild verbreitern</string>
<string name="spatial_detail">Mitte/Seite-Verarbeitung: Was an den Seiten liegt, tritt hervor, was in der Mitte liegt, bleibt, wo es ist. Nur Songs aus Erweiterungen, Downloads und lokalen Dateien: Spotifys eigene Streams werden nicht bearbeitet. Mono-Songs, und aus alles, bleiben unverändert.</string>
@@ -690,7 +706,7 @@
<string name="settings_automix_show">Mix im Player zeigen</string>
<string name="settings_automix_show_detail">Der Abschnitt des Mixes ist auf der Fortschrittsleiste farbig, und das Cover leuchtet und pulsiert im Takt, solange er läuft.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">DJ-artige Übergänge zwischen Songs aus Erweiterungen, Downloads und lokalen Dateien: Jeder Song wird einmal analysiert (Beats, Takte, Phrasen, Tonart) und der nächste setzt im Takt und im gleichen Tempo ein, mit einem Bass-Tausch. Songs, die sich nicht angleichen lassen, bekommen einen Schnitt im Takt oder eine Blende. Streams werden nur in unbegrenzten Netzen analysiert.</string>
+ <string name="settings_automix_detail">DJ-artige Übergänge zwischen Songs aus Erweiterungen, Downloads und lokalen Dateien: Jeder Song wird einmal analysiert (Beats, Takte, Phrasen, Tonart) und der nächste setzt im Takt und im gleichen Tempo ein, mit einem Bass-Tausch. Songs, die sich nicht angleichen lassen, bekommen einen Schnitt im Takt oder eine Blende. Streams werden in unbegrenzten Netzen analysiert, oder über mobile Daten, wenn du es unten erlaubst.</string>
<string name="settings_automix_length">Mix-Länge</string>
<string name="settings_automix_length_short">Kurz</string>
<string name="settings_automix_length_auto">Ausgewogen</string>
@@ -705,6 +721,46 @@
<string name="settings_automix_pulse">Player-Animation</string>
<string name="settings_automix_pulse_subtle">Dezent</string>
<string name="settings_automix_pulse_strong">Stark</string>
+ <string name="settings_automix_style">Übergangsstil</string>
+ <string name="settings_automix_style_blend">Beat-Mix</string>
+ <string name="settings_automix_style_cut">Schnitt auf dem Beat</string>
+ <string name="settings_automix_style_fade">Sanfte Blende</string>
+ <string name="settings_automix_style_detail">Der Beat-Mix gleicht die Tempos an, wo es geht, sonst schneidet er auf dem Beat oder blendet. Der Schnitt auf dem Beat wechselt auf einer Eins. Die sanfte Blende blendet, ohne das Tempo zu ändern.</string>
+ <string name="settings_automix_length_detail">Kurz: 4 bis 8 Takte. Ausgewogen: 2 bis 16, wie die Musik es zulässt. Lang: 12 bis 32 Takte, bis etwa eine Minute.</string>
+ <string name="settings_automix_harmonic">Harmonisches Mixen</string>
+ <string name="settings_automix_harmonic_detail">Songs in unpassenden Tonarten bekommen kurze Mixe, passende lange. Aus: Tonarten werden ignoriert.</string>
+ <string name="settings_automix_podcasts">Podcasts mixen</string>
+ <string name="settings_automix_podcasts_detail">Aus: Podcastfolgen und Hörbücher beginnen und enden vollständig.</string>
+ <string name="settings_automix_mobile_data">Über mobile Daten analysieren</string>
+ <string name="settings_automix_mobile_data_detail">Songs aus Erweiterungen werden auch über mobile Daten analysiert. Jeder wird dafür ein zweites Mal geladen: etwa so viele Daten wie beim Abspielen. Aus: nur im WLAN.</string>
<string name="playback_speed_note">Tempo %1$s× · tippen für 1×</string>
<string name="jam_start_premium">Einen Jam starten braucht Spotify Premium. Beitreten geht mit dem Link oder QR-Code.</string>
+ <string name="settings_dynamic_color_title">Dynamische Farben (Material You)</string>
+ <string name="settings_dynamic_color_detail">Die Akzentfarbe des Looks „Klassisch“ kommt von deinem Hintergrundbild. Der Look „Immersiv“ behält die Farben des laufenden Covers.</string>
+ <string name="settings_system_font_title">Systemschriftart</string>
+ <string name="settings_system_font_detail">Zeigt die Texte der App in der Schriftart deines Handys statt in der von Myspoti</string>
+ <string name="settings_download_lyrics_title">Songtexte mit Songs herunterladen</string>
+ <string name="settings_download_lyrics_detail">Ein heruntergeladener Song behält seinen Songtext, auch ohne Verbindung</string>
+ <string name="settings_section_storage">Speicher</string>
+ <string name="settings_storage_media_cache">Mediencache</string>
+ <string name="settings_storage_media_cache_detail">Canvas-Videos, die auf diesem Telefon bleiben, damit sie nicht erneut geladen werden.</string>
+ <string name="settings_storage_media_cache_restart">Canvas-Videos, die auf diesem Telefon bleiben. Die neue Größe gilt ab dem nächsten Start der App.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Cache leeren</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: Canvas-Videos, Cover und AutoMix-Analysen. Downloads bleiben erhalten.</string>
+ <string name="settings_storage_cleared">Cache geleert</string>
+ <string name="settings_automix_cache">AutoMix-Analysen</string>
+ <string name="settings_automix_cache_detail">%1$s auf diesem Telefon. Nach dem Leeren werden Songs beim Abspielen erneut analysiert.</string>
+ <string name="settings_automix_cache_clear">Leeren</string>
+ <string name="settings_automix_intro_title">So funktioniert AutoMix</string>
+ <string name="settings_automix_intro_text">AutoMix mixt die Songs, die Myspoti selbst abspielt: aus Erweiterungen, Downloads und Dateien auf diesem Telefon. Spotify-Songs laufen im Webplayer von Spotify, dessen Ton die App nie bekommt: Sie werden nur übergeblendet.\n\nJeder Song wird einmal analysiert (Beats, Takte, Tonart). Streams werden im WLAN analysiert, oder über mobile Daten, wenn du es erlaubst; ein nicht rechtzeitig analysierter Song wird übergeblendet.</string>
+ <string name="settings_automix_intro_ok">Verstanden</string>
+ <string name="automix_reason_spotify">Gerade kein Mix: Spotify-Songs laufen im Webplayer von Spotify und werden nur übergeblendet.</string>
+ <string name="automix_reason_cast">Gerade kein Mix: Auf einem Cast-Gerät wechseln die Songs ohne Mix.</string>
+ <string name="automix_reason_podcast">Gerade kein Mix: Podcasts und Hörbücher beginnen und enden vollständig.</string>
+ <string name="automix_reason_album">Gerade kein Mix: Der nächste Song folgt auf seinem Album auf diesen.</string>
+ <string name="automix_reason_mobile_data">Gerade kein Mix: Der nächste Stream wird über mobile Daten nicht analysiert und daher übergeblendet.</string>
+ <string name="automix_reason_frugal">Gerade kein Mix: Der nächste Song wurde im Energiesparmodus nicht rechtzeitig analysiert und wird übergeblendet.</string>
+ <string name="automix_reason_not_analyzed">Gerade kein Mix: Der nächste Song konnte nicht rechtzeitig analysiert werden und wird übergeblendet.</string>
</resources>
diff --git a/base/app/src/main/res/values-de/nerd_strings.xml b/base/app/src/main/res/values-de/nerd_strings.xml
index b23d266d..f08e573f 100644
--- a/base/app/src/main/res/values-de/nerd_strings.xml
+++ b/base/app/src/main/res/values-de/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Aus</string>
<string name="nerd_spotify_note">Der Spotify-Stream ist in der Seite verschlüsselt: Sein genauer Codec und seine Bitrate sind nicht zugänglich, nur das, was die Seite angibt.</string>
<string name="nerd_spotify_remote">Der Klang kommt von einem anderen Gerät: Dieses Telefon steuert es nur.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Beatgenaue Blende</string>
+ <string name="nerd_automix_cut">Schnitt auf dem Beat</string>
+ <string name="nerd_automix_fade">Überblendung</string>
+ <string name="nerd_automix_mixing">Mix läuft: %1$s</string>
+ <string name="nerd_automix_planned">%1$s bei %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">An, noch kein Mix geplant</string>
</resources>
diff --git a/base/app/src/main/res/values-el/myspoti_strings.xml b/base/app/src/main/res/values-el/myspoti_strings.xml
index 631e3bac..162f9e51 100644
--- a/base/app/src/main/res/values-el/myspoti_strings.xml
+++ b/base/app/src/main/res/values-el/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Επαληθευμένος καλλιτέχνης</string>
<string name="lyrics_share">Κοινοποίηση στίχων</string>
<string name="lyrics_extra_title">Περισσότερες πηγές στίχων</string>
+ <string name="settings_section_lyrics">Στίχοι</string>
+ <string name="settings_lyrics_romanization_detail">Κάτω από τις γραμμές, το τραγούδι με λατινικούς χαρακτήρες, όταν οι στίχοι το έχουν</string>
+ <string name="lyrics_translation_title">Γλώσσα μετάφρασης</string>
+ <string name="lyrics_translation_detail">Η γλώσσα στην οποία μεταφράζονται οι στίχοι. Αυτόματη: η γλώσσα της συσκευής.</string>
<string name="lyrics_extra_summary">NetEase και Genius, όταν το Spotify δεν έχει στίχους</string>
<string name="lyrics_reload">Επαναφόρτωση στίχων</string>
<string name="lyrics_select_hint">Πατήστε στίχους για να επιλέξετε τι θα μοιραστείτε</string>
@@ -666,6 +670,18 @@
<string name="settings_player_volume_detail">Το ρυθμιστικό έντασης κάτω από τα κουμπιά. Απενεργοποιημένη, τα πλήκτρα έντασης του τηλεφώνου τη ρυθμίζουν ακόμα.</string>
<string name="settings_lyrics_keep_awake_title">Οθόνη ανοιχτή με τους στίχους</string>
<string name="settings_lyrics_keep_awake_detail">Όσο οι στίχοι είναι ανοιχτοί, η οθόνη δεν σβήνει μόνη της.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Παραλείπει χορηγικά μηνύματα και άλλα τμήματα επεισοδίων podcast που έχει σημειώσει η κοινότητα του SponsorBlock. Ρωτά το sponsor.ajay.app για το επεισόδιο που παίζει (και το YouTube, για να βρει τη μεταφόρτωσή του όταν χρειάζεται)· δεν στέλνεται τίποτα για εσάς ή τον λογαριασμό σας.</string>
+ <string name="sponsorblock_skip_header">Τμήματα για παράλειψη</string>
+ <string name="sponsorblock_cat_sponsor">Χορηγοί</string>
+ <string name="sponsorblock_cat_sponsor_detail">Πληρωμένες προωθήσεις και διαφημίσεις</string>
+ <string name="sponsorblock_cat_selfpromo">Αυτοπροβολή</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Προϊόντα της εκπομπής, Patreon, άλλες εκπομπές</string>
+ <string name="sponsorblock_cat_intro_outro">Εισαγωγή και κλείσιμο</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Μουσική αρχής και τέλους, τίτλοι</string>
+ <string name="sponsorblock_cat_interaction">Υπενθυμίσεις</string>
+ <string name="sponsorblock_cat_interaction_detail">Προτροπές για ακολούθηση, βαθμολογία ή εγγραφή</string>
+ <string name="sponsorblock_skipped">Παραλείφθηκε: %1$s</string>
<string name="spatial_title">Χωρικός ήχος</string>
<string name="spatial_enable">Διεύρυνση του στερεοφωνικού</string>
<string name="spatial_detail">Επεξεργασία mid/side: ό,τι βρίσκεται στα πλάγια αναδεικνύεται, ό,τι βρίσκεται στη μέση μένει στη θέση του. Μόνο τραγούδια από επεκτάσεις, λήψεις και τοπικά αρχεία: οι ροές του ίδιου του Spotify δεν επεξεργάζονται. Τα μονοφωνικά τραγούδια, και όλα όταν είναι ανενεργό, περνούν ανέγγιχτα.</string>
@@ -690,7 +706,7 @@
<string name="settings_automix_show">Η μίξη στο πρόγραμμα αναπαραγωγής</string>
<string name="settings_automix_show_detail">Το τμήμα της μίξης χρωματίζεται στη γραμμή αναπαραγωγής και το εξώφυλλο λάμπει και πάλλεται στον ρυθμό όσο διαρκεί.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Μεταβάσεις σαν DJ ανάμεσα σε τραγούδια από επεκτάσεις, λήψεις και τοπικά αρχεία: κάθε τραγούδι αναλύεται μία φορά (χτύποι, μέτρα, φράσεις, τονικότητα) και το επόμενο μπαίνει στον ρυθμό, στο ίδιο τέμπο, με εναλλαγή των μπάσων. Όσα δεν συγχρονίζονται παίρνουν κόψιμο στον ρυθμό ή σβήσιμο. Οι ροές αναλύονται μόνο σε δίκτυα χωρίς χρέωση δεδομένων.</string>
+ <string name="settings_automix_detail">Μεταβάσεις σαν DJ ανάμεσα σε τραγούδια από επεκτάσεις, λήψεις και τοπικά αρχεία: κάθε τραγούδι αναλύεται μία φορά (χτύποι, μέτρα, φράσεις, τονικότητα) και το επόμενο μπαίνει στον ρυθμό, στο ίδιο τέμπο, με εναλλαγή των μπάσων. Όσα δεν συγχρονίζονται παίρνουν κόψιμο στον ρυθμό ή σβήσιμο. Οι ροές αναλύονται σε δίκτυα χωρίς χρέωση δεδομένων, ή με δεδομένα κινητής αν το επιτρέψετε παρακάτω.</string>
<string name="settings_automix_length">Διάρκεια μίξης</string>
<string name="settings_automix_length_short">Σύντομη</string>
<string name="settings_automix_length_auto">Ισορροπημένη</string>
@@ -705,6 +721,46 @@
<string name="settings_automix_pulse">Κίνηση προγράμματος αναπαραγωγής</string>
<string name="settings_automix_pulse_subtle">Διακριτική</string>
<string name="settings_automix_pulse_strong">Έντονη</string>
+ <string name="settings_automix_style">Στυλ μετάβασης</string>
+ <string name="settings_automix_style_blend">Μίξη στον ρυθμό</string>
+ <string name="settings_automix_style_cut">Κοπή στον χρόνο</string>
+ <string name="settings_automix_style_fade">Ομαλό σβήσιμο</string>
+ <string name="settings_automix_style_detail">Η μίξη στον ρυθμό ταιριάζει τα τέμπο όταν μπορεί, αλλιώς κόβει στον χρόνο ή σβήνει. Η κοπή στον χρόνο αλλάζει τραγούδι σε ισχυρό χρόνο. Το ομαλό σβήσιμο δεν αλλάζει το τέμπο.</string>
+ <string name="settings_automix_length_detail">Σύντομη: 4 έως 8 μέτρα. Ισορροπημένη: 2 έως 16, όπως επιτρέπει η μουσική. Μεγάλη: 12 έως 32 μέτρα, έως περίπου ένα λεπτό.</string>
+ <string name="settings_automix_harmonic">Αρμονική μίξη</string>
+ <string name="settings_automix_harmonic_detail">Τραγούδια σε τονικότητες που συγκρούονται παίρνουν σύντομες μίξεις, σε συμβατές μεγάλες. Ανενεργό: η τονικότητα αγνοείται.</string>
+ <string name="settings_automix_podcasts">Μίξη podcast</string>
+ <string name="settings_automix_podcasts_detail">Ανενεργό: τα επεισόδια podcast και τα ηχητικά βιβλία ξεκινούν και τελειώνουν ολόκληρα.</string>
+ <string name="settings_automix_mobile_data">Ανάλυση με δεδομένα κινητής</string>
+ <string name="settings_automix_mobile_data_detail">Τα τραγούδια από επεκτάσεις αναλύονται και με δεδομένα κινητής. Το καθένα κατεβαίνει δεύτερη φορά γι\' αυτό: περίπου όσα δεδομένα και η ακρόασή του. Ανενεργό: μόνο σε Wi-Fi.</string>
<string name="playback_speed_note">Ταχύτητα %1$s× · πάτησε για 1×</string>
<string name="jam_start_premium">Η έναρξη Jam απαιτεί Spotify Premium. Μπορείς να μπεις σε ένα με τον σύνδεσμο ή τον κωδικό QR.</string>
+ <string name="settings_dynamic_color_title">Δυναμικά χρώματα (Material You)</string>
+ <string name="settings_dynamic_color_detail">Το χρώμα έμφασης της εμφάνισης «Κλασική» προέρχεται από την ταπετσαρία σου. Η εμφάνιση «Εμβυθιστική» κρατά τα χρώματα του εξώφυλλου που παίζει.</string>
+ <string name="settings_system_font_title">Γραμματοσειρά συστήματος</string>
+ <string name="settings_system_font_detail">Εμφανίζει το κείμενο της εφαρμογής με τη γραμματοσειρά του τηλεφώνου σου αντί για αυτή του Myspoti</string>
+ <string name="settings_download_lyrics_title">Λήψη στίχων μαζί με τα τραγούδια</string>
+ <string name="settings_download_lyrics_detail">Ένα τραγούδι που έχει ληφθεί κρατά τους στίχους του, που εμφανίζονται χωρίς σύνδεση</string>
+ <string name="settings_section_storage">Αποθηκευτικός χώρος</string>
+ <string name="settings_storage_media_cache">Προσωρινή μνήμη πολυμέσων</string>
+ <string name="settings_storage_media_cache_detail">Βίντεο Canvas που μένουν σε αυτό το τηλέφωνο, για να μην κατεβαίνουν ξανά.</string>
+ <string name="settings_storage_media_cache_restart">Βίντεο Canvas που μένουν σε αυτό το τηλέφωνο. Το νέο μέγεθος ισχύει στην επόμενη εκκίνηση της εφαρμογής.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Εκκαθάριση προσωρινής μνήμης</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: βίντεο Canvas, εξώφυλλα και αναλύσεις AutoMix. Οι λήψεις διατηρούνται.</string>
+ <string name="settings_storage_cleared">Η προσωρινή μνήμη εκκαθαρίστηκε</string>
+ <string name="settings_automix_cache">Αναλύσεις AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s σε αυτό το τηλέφωνο. Μετά την εκκαθάριση, τα τραγούδια αναλύονται ξανά όταν παίζουν.</string>
+ <string name="settings_automix_cache_clear">Εκκαθάριση</string>
+ <string name="settings_automix_intro_title">Πώς λειτουργεί το AutoMix</string>
+ <string name="settings_automix_intro_text">Το AutoMix μιξάρει τα τραγούδια που παίζει το ίδιο το Myspoti: από επεκτάσεις, λήψεις και αρχεία του τηλεφώνου. Τα τραγούδια του Spotify παίζουν στο web player του Spotify, του οποίου τον ήχο η εφαρμογή δεν έχει ποτέ: αλλάζουν μόνο με σβήσιμο.\n\nΚάθε τραγούδι αναλύεται μία φορά (beat, μέτρα, τονικότητα). Οι ροές αναλύονται σε Wi-Fi, ή με δεδομένα κινητής αν το επιτρέψετε· ένα τραγούδι που δεν αναλύθηκε εγκαίρως αλλάζει με σβήσιμο.</string>
+ <string name="settings_automix_intro_ok">Κατάλαβα</string>
+ <string name="automix_reason_spotify">Καμία μίξη τώρα: τα τραγούδια του Spotify παίζουν στο web player του Spotify και αλλάζουν μόνο με σβήσιμο.</string>
+ <string name="automix_reason_cast">Καμία μίξη τώρα: σε συσκευή Cast τα τραγούδια αλλάζουν χωρίς μίξη.</string>
+ <string name="automix_reason_podcast">Καμία μίξη τώρα: τα podcast και τα ηχητικά βιβλία ξεκινούν και τελειώνουν ολόκληρα.</string>
+ <string name="automix_reason_album">Καμία μίξη τώρα: το επόμενο τραγούδι ακολουθεί αυτό στο άλμπουμ του.</string>
+ <string name="automix_reason_mobile_data">Καμία μίξη τώρα: η επόμενη ροή δεν αναλύεται με δεδομένα κινητής, οπότε αλλάζει με σβήσιμο.</string>
+ <string name="automix_reason_frugal">Καμία μίξη τώρα: το επόμενο τραγούδι δεν αναλύθηκε εγκαίρως λόγω εξοικονόμησης ενέργειας, οπότε αλλάζει με σβήσιμο.</string>
+ <string name="automix_reason_not_analyzed">Καμία μίξη τώρα: το επόμενο τραγούδι δεν αναλύθηκε εγκαίρως, οπότε αλλάζει με σβήσιμο.</string>
</resources>
diff --git a/base/app/src/main/res/values-el/nerd_strings.xml b/base/app/src/main/res/values-el/nerd_strings.xml
index df560f8e..3c3c5a77 100644
--- a/base/app/src/main/res/values-el/nerd_strings.xml
+++ b/base/app/src/main/res/values-el/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Ανενεργός</string>
<string name="nerd_spotify_note">Η ροή του Spotify είναι κρυπτογραφημένη μέσα στη σελίδα: ο ακριβής κωδικοποιητής και ο ρυθμός bit της δεν είναι προσβάσιμοι, μόνο όσα δηλώνει η σελίδα.</string>
<string name="nerd_spotify_remote">Ο ήχος προέρχεται από άλλη συσκευή: αυτό το τηλέφωνο απλώς την ελέγχει.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Μίξη στο beat</string>
+ <string name="nerd_automix_cut">Κόψιμο στο beat</string>
+ <string name="nerd_automix_fade">Σβήσιμο</string>
+ <string name="nerd_automix_mixing">Μίξη τώρα: %1$s</string>
+ <string name="nerd_automix_planned">%1$s στο %2$s, %3$d δ</string>
+ <string name="nerd_automix_waiting">Ενεργό, καμία μίξη σε πρόγραμμα ακόμη</string>
</resources>
diff --git a/base/app/src/main/res/values-es/myspoti_strings.xml b/base/app/src/main/res/values-es/myspoti_strings.xml
index 0c5b1992..a50c1369 100644
--- a/base/app/src/main/res/values-es/myspoti_strings.xml
+++ b/base/app/src/main/res/values-es/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Artista verificado</string>
<string name="lyrics_share">Compartir letra</string>
<string name="lyrics_extra_title">Más fuentes de letras</string>
+ <string name="settings_section_lyrics">Letras</string>
+ <string name="settings_lyrics_romanization_detail">Debajo de los versos, la canción en letras latinas, cuando la letra la tiene</string>
+ <string name="lyrics_translation_title">Idioma de traducción</string>
+ <string name="lyrics_translation_detail">El idioma al que se traducen las letras. Automático: el idioma del teléfono.</string>
<string name="lyrics_extra_summary">NetEase y Genius, cuando Spotify no tiene la letra</string>
<string name="lyrics_reload">Recargar la letra</string>
<string name="lyrics_select_hint">Toca las líneas para elegir lo que quieres compartir</string>
@@ -666,6 +670,18 @@
<string name="settings_player_volume_detail">El control de volumen bajo los botones. Desactivada, los botones de volumen del teléfono siguen ajustándolo.</string>
<string name="settings_lyrics_keep_awake_title">Mantener la pantalla encendida con la letra</string>
<string name="settings_lyrics_keep_awake_detail">Mientras la letra está abierta, la pantalla no se apaga sola.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Salta las menciones de patrocinadores y otras partes de los episodios de pódcast marcadas por la comunidad de SponsorBlock. Consulta a sponsor.ajay.app sobre el episodio en reproducción (y a YouTube, para encontrar su subida si hace falta); no se envía nada sobre ti ni tu cuenta.</string>
+ <string name="sponsorblock_skip_header">Partes que saltar</string>
+ <string name="sponsorblock_cat_sponsor">Patrocinadores</string>
+ <string name="sponsorblock_cat_sponsor_detail">Promociones pagadas y anuncios leídos</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromoción</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Productos del programa, Patreon, otros programas</string>
+ <string name="sponsorblock_cat_intro_outro">Intro y cierre</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Música de apertura y de cierre, créditos</string>
+ <string name="sponsorblock_cat_interaction">Recordatorios</string>
+ <string name="sponsorblock_cat_interaction_detail">Peticiones de seguir, valorar o suscribirse</string>
+ <string name="sponsorblock_skipped">Saltado: %1$s</string>
<string name="spatial_title">Audio espacial</string>
<string name="spatial_enable">Ampliar el estéreo</string>
<string name="spatial_detail">Procesado medio/lateral: lo que está a los lados se realza, lo que está en el centro se queda donde está. Solo canciones de extensiones, descargas y archivos locales: las transmisiones propias de Spotify no se procesan. Las canciones mono, y todo cuando está desactivado, pasan sin tocarse.</string>
@@ -690,7 +706,7 @@
<string name="settings_automix_show">Mostrar la mezcla en el reproductor</string>
<string name="settings_automix_show_detail">El tramo de la mezcla se colorea en la barra de reproducción, y la portada brilla y late al ritmo mientras suena.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Transiciones al estilo DJ entre canciones de extensiones, descargas y archivos locales: cada canción se analiza una vez (pulsos, compases, frases, tonalidad) y la siguiente entra a tiempo, con el tempo igualado y un intercambio de graves. Las que no se pueden sincronizar tienen un corte a tiempo o un fundido. Las transmisiones solo se analizan en redes sin límite de datos.</string>
+ <string name="settings_automix_detail">Transiciones al estilo DJ entre canciones de extensiones, descargas y archivos locales: cada canción se analiza una vez (pulsos, compases, frases, tonalidad) y la siguiente entra a tiempo, con el tempo igualado y un intercambio de graves. Las que no se pueden sincronizar tienen un corte a tiempo o un fundido. Las transmisiones se analizan en redes sin límite de datos, o con datos móviles si lo permites abajo.</string>
<string name="settings_automix_length">Duración de la mezcla</string>
<string name="settings_automix_length_short">Corta</string>
<string name="settings_automix_length_auto">Equilibrada</string>
@@ -705,6 +721,46 @@
<string name="settings_automix_pulse">Animación del reproductor</string>
<string name="settings_automix_pulse_subtle">Suave</string>
<string name="settings_automix_pulse_strong">Fuerte</string>
+ <string name="settings_automix_style">Estilo de transición</string>
+ <string name="settings_automix_style_blend">Mezcla al ritmo</string>
+ <string name="settings_automix_style_cut">Corte en el tiempo</string>
+ <string name="settings_automix_style_fade">Fundido suave</string>
+ <string name="settings_automix_style_detail">La mezcla al ritmo iguala los tempos cuando puede; si no, corta en el tiempo o hace un fundido. El corte en el tiempo cambia de canción en un primer tiempo. El fundido suave funde sin tocar el tempo.</string>
+ <string name="settings_automix_length_detail">Corta: 4 a 8 compases. Equilibrada: 2 a 16, según la música. Larga: 12 a 32 compases, hasta un minuto aproximadamente.</string>
+ <string name="settings_automix_harmonic">Mezcla armónica</string>
+ <string name="settings_automix_harmonic_detail">Las canciones en tonalidades que chocan tienen mezclas cortas; las compatibles, largas. Desactivada, se ignora la tonalidad.</string>
+ <string name="settings_automix_podcasts">Mezclar pódcast</string>
+ <string name="settings_automix_podcasts_detail">Desactivado, los episodios de pódcast y los audiolibros empiezan y terminan enteros.</string>
+ <string name="settings_automix_mobile_data">Analizar con datos móviles</string>
+ <string name="settings_automix_mobile_data_detail">Las canciones de extensiones también se analizan con datos móviles. Cada una se descarga una segunda vez para ello: más o menos los mismos datos que al escucharla. Desactivado, solo con Wi-Fi.</string>
<string name="playback_speed_note">Velocidad %1$s× · toca para 1×</string>
<string name="jam_start_premium">Iniciar una Jam requiere Spotify Premium. Puedes unirte a una con su enlace o código QR.</string>
+ <string name="settings_dynamic_color_title">Colores dinámicos (Material You)</string>
+ <string name="settings_dynamic_color_detail">El color de acento del aspecto Clásico viene de tu fondo de pantalla. El aspecto Inmersivo mantiene los colores de la portada en reproducción.</string>
+ <string name="settings_system_font_title">Fuente del sistema</string>
+ <string name="settings_system_font_detail">Muestra el texto de la app con la fuente de tu teléfono en lugar de la de Myspoti</string>
+ <string name="settings_download_lyrics_title">Descargar letras con las canciones</string>
+ <string name="settings_download_lyrics_detail">Una canción descargada guarda su letra, que se muestra sin conexión</string>
+ <string name="settings_section_storage">Almacenamiento</string>
+ <string name="settings_storage_media_cache">Caché multimedia</string>
+ <string name="settings_storage_media_cache_detail">Vídeos Canvas guardados en este teléfono para no descargarlos de nuevo.</string>
+ <string name="settings_storage_media_cache_restart">Vídeos Canvas guardados en este teléfono. El nuevo tamaño se aplica la próxima vez que se inicie la app.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Borrar caché</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: vídeos Canvas, portadas y análisis de AutoMix. Las descargas se conservan.</string>
+ <string name="settings_storage_cleared">Caché borrada</string>
+ <string name="settings_automix_cache">Análisis de AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s en este teléfono. Si se borran, las canciones se analizan de nuevo al sonar.</string>
+ <string name="settings_automix_cache_clear">Borrar</string>
+ <string name="settings_automix_intro_title">Cómo funciona AutoMix</string>
+ <string name="settings_automix_intro_text">AutoMix mezcla las canciones que Myspoti reproduce por sí mismo: de extensiones, descargas y archivos de este teléfono. Las canciones de Spotify suenan en el reproductor web de Spotify, cuyo sonido la app nunca tiene: solo cambian con un fundido.\n\nCada canción se analiza una vez (pulsos, compases, tonalidad). Las transmisiones se analizan con Wi-Fi, o con datos móviles si lo permites; una canción no analizada a tiempo cambia con un fundido.</string>
+ <string name="settings_automix_intro_ok">Entendido</string>
+ <string name="automix_reason_spotify">Sin mezcla ahora: las canciones de Spotify suenan en el reproductor web de Spotify y solo cambian con un fundido.</string>
+ <string name="automix_reason_cast">Sin mezcla ahora: en un dispositivo Cast las canciones cambian sin mezcla.</string>
+ <string name="automix_reason_podcast">Sin mezcla ahora: los podcasts y audiolibros empiezan y terminan enteros.</string>
+ <string name="automix_reason_album">Sin mezcla ahora: la siguiente canción sigue a esta en su álbum.</string>
+ <string name="automix_reason_mobile_data">Sin mezcla ahora: la siguiente transmisión no se analiza con datos móviles, así que cambia con un fundido.</string>
+ <string name="automix_reason_frugal">Sin mezcla ahora: la siguiente canción no se analizó a tiempo por el ahorro de energía, así que cambia con un fundido.</string>
+ <string name="automix_reason_not_analyzed">Sin mezcla ahora: la siguiente canción no se pudo analizar a tiempo, así que cambia con un fundido.</string>
</resources>
diff --git a/base/app/src/main/res/values-es/nerd_strings.xml b/base/app/src/main/res/values-es/nerd_strings.xml
index d5734cd4..558df8d6 100644
--- a/base/app/src/main/res/values-es/nerd_strings.xml
+++ b/base/app/src/main/res/values-es/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Desactivado</string>
<string name="nerd_spotify_note">El flujo de Spotify está cifrado dentro de la página: su códec y tasa de bits exactos no son accesibles, solo lo que la página anuncia.</string>
<string name="nerd_spotify_remote">El sonido viene de otro dispositivo: este teléfono solo lo controla.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Mezcla al ritmo</string>
+ <string name="nerd_automix_cut">Corte en el pulso</string>
+ <string name="nerd_automix_fade">Fundido</string>
+ <string name="nerd_automix_mixing">Mezclando: %1$s</string>
+ <string name="nerd_automix_planned">%1$s en %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">Activado, aún sin mezcla prevista</string>
</resources>
diff --git a/base/app/src/main/res/values-fr/myspoti_strings.xml b/base/app/src/main/res/values-fr/myspoti_strings.xml
index 653e1445..41becec5 100644
--- a/base/app/src/main/res/values-fr/myspoti_strings.xml
+++ b/base/app/src/main/res/values-fr/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Artiste vérifié</string>
<string name="lyrics_share">Partager des paroles</string>
<string name="lyrics_extra_title">Plus de sources de paroles</string>
+ <string name="settings_section_lyrics">Paroles</string>
+ <string name="settings_lyrics_romanization_detail">Sous les lignes, la chanson en lettres latines, quand les paroles l\'ont</string>
+ <string name="lyrics_translation_title">Langue de traduction</string>
+ <string name="lyrics_translation_detail">La langue dans laquelle les paroles sont traduites. Automatique : la langue du téléphone.</string>
<string name="lyrics_extra_summary">NetEase et Genius, quand Spotify n\'a pas les paroles</string>
<string name="lyrics_reload">Recharger les paroles</string>
<string name="lyrics_select_hint">Touchez des lignes pour choisir ce que vous partagez</string>
@@ -396,7 +400,7 @@
<string name="myspoti_shuffle_detail">Avec la lecture aléatoire activée, une playlist, un album ou les titres likés jouent chaque titre une fois, dans un ordre aléatoire, avant de recommencer. Désactivée : la lecture aléatoire de Spotify. Un compte gratuit peut garder celle de Spotify sur certaines listes.</string>
<string name="myspoti_shuffle_imposed">Spotify garde sa propre lecture aléatoire sur cette liste pour votre compte : la lecture aléatoire Myspoti y est désactivée.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Transitions façon DJ entre les morceaux des extensions, des téléchargements et des fichiers locaux : chaque morceau est analysé une fois (temps, mesures, phrases, tonalité) et le suivant entre sur le temps, au même tempo, avec un échange des basses. Les morceaux impossibles à caler ont une coupe sur le temps ou un fondu. Les flux ne sont analysés que sur un réseau non limité.</string>
+ <string name="settings_automix_detail">Transitions façon DJ entre les morceaux des extensions, des téléchargements et des fichiers locaux : chaque morceau est analysé une fois (temps, mesures, phrases, tonalité) et le suivant entre sur le temps, au même tempo, avec un échange des basses. Les morceaux impossibles à caler ont une coupe sur le temps ou un fondu. Les flux sont analysés sur un réseau non limité, ou en données mobiles si vous l\'autorisez ci-dessous.</string>
<string name="settings_crossfade_title">Fondu enchaîné</string>
<string name="settings_crossfade_detail">Les morceaux issus d\'extensions, de téléchargements et de fichiers locaux se chevauchent : la fin de l\'un s\'efface pendant que le suivant monte. Les flux Spotify ne peuvent pas se chevaucher (un seul flux audio) : ils s\'effacent puis remontent seulement.</string>
<string name="settings_crossfade_off">Désactivé</string>
@@ -673,6 +677,18 @@
<string name="settings_player_volume_detail">Le curseur de volume sous les commandes. Désactivée, les boutons de volume du téléphone le règlent toujours.</string>
<string name="settings_lyrics_keep_awake_title">Garder l\'écran allumé avec les paroles</string>
<string name="settings_lyrics_keep_awake_detail">Tant que les paroles sont ouvertes, l\'écran ne s\'éteint pas tout seul.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Saute les passages sponsorisés et autres parties d\'épisodes de podcast signalées par la communauté SponsorBlock. Interroge sponsor.ajay.app sur l\'épisode en cours (et YouTube, pour trouver sa mise en ligne si besoin) ; rien sur vous ni sur votre compte n\'est envoyé.</string>
+ <string name="sponsorblock_skip_header">Parties à sauter</string>
+ <string name="sponsorblock_cat_sponsor">Sponsors</string>
+ <string name="sponsorblock_cat_sponsor_detail">Promotions payées et lectures de pub</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromotion</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Produits de l\'émission, Patreon, autres émissions</string>
+ <string name="sponsorblock_cat_intro_outro">Intro et outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Musique d\'ouverture et de fin, crédits</string>
+ <string name="sponsorblock_cat_interaction">Rappels</string>
+ <string name="sponsorblock_cat_interaction_detail">Demandes de s\'abonner, noter ou suivre</string>
+ <string name="sponsorblock_skipped">Passé : %1$s</string>
<string name="spatial_title">Audio spatial</string>
<string name="spatial_enable">Élargir la stéréo</string>
<string name="spatial_detail">Traitement mid/side : ce qui est sur les côtés ressort, ce qui est au centre reste en place. Seulement les titres des extensions, les téléchargements et les fichiers locaux : les flux de Spotify lui-même ne sont pas traités. Les titres mono, et tout quand c\'est désactivé, passent sans être touchés.</string>
@@ -710,6 +726,46 @@
<string name="settings_automix_pulse">Animation du lecteur</string>
<string name="settings_automix_pulse_subtle">Légère</string>
<string name="settings_automix_pulse_strong">Forte</string>
+ <string name="settings_automix_style">Style de transition</string>
+ <string name="settings_automix_style_blend">Mix sur le temps</string>
+ <string name="settings_automix_style_cut">Coupe sur le temps</string>
+ <string name="settings_automix_style_fade">Fondu doux</string>
+ <string name="settings_automix_style_detail">Le mix sur le temps cale les tempos quand il le peut, sinon il coupe sur le temps ou fait un fondu. La coupe sur le temps change de morceau sur un premier temps. Le fondu doux fond sans toucher au tempo.</string>
+ <string name="settings_automix_length_detail">Court : 4 à 8 mesures. Équilibré : 2 à 16, selon la musique. Long : 12 à 32 mesures, jusqu\'à une minute environ.</string>
+ <string name="settings_automix_harmonic">Mix harmonique</string>
+ <string name="settings_automix_harmonic_detail">Les morceaux de tonalités qui se heurtent ont des mix courts, les tonalités proches des mix longs. Désactivé, la tonalité est ignorée.</string>
+ <string name="settings_automix_podcasts">Mixer les podcasts</string>
+ <string name="settings_automix_podcasts_detail">Désactivé, les épisodes de podcast et les livres audio commencent et finissent entiers.</string>
+ <string name="settings_automix_mobile_data">Analyser en données mobiles</string>
+ <string name="settings_automix_mobile_data_detail">Les morceaux des extensions sont aussi analysés en données mobiles. Chacun est téléchargé une seconde fois pour cela : à peu près autant de données que pour l\'écouter. Désactivé, en Wi-Fi seulement.</string>
<string name="playback_speed_note">Vitesse %1$s× · toucher pour 1×</string>
<string name="jam_start_premium">Lancer un Jam demande Spotify Premium. Tu peux en rejoindre un avec son lien ou son QR code.</string>
+ <string name="settings_dynamic_color_title">Couleurs dynamiques (Material You)</string>
+ <string name="settings_dynamic_color_detail">L\'accent du look Classique vient de ton fond d\'écran. Le look Immersif garde les couleurs de la pochette en cours.</string>
+ <string name="settings_system_font_title">Police du système</string>
+ <string name="settings_system_font_detail">Affiche le texte de l\'app avec la police de ton téléphone au lieu de celle de Myspoti</string>
+ <string name="settings_download_lyrics_title">Télécharger les paroles avec les titres</string>
+ <string name="settings_download_lyrics_detail">Un titre téléchargé garde ses paroles, affichées sans connexion</string>
+ <string name="settings_section_storage">Stockage</string>
+ <string name="settings_storage_media_cache">Cache média</string>
+ <string name="settings_storage_media_cache_detail">Vidéos Canvas gardées sur ce téléphone, pour ne pas les télécharger à nouveau.</string>
+ <string name="settings_storage_media_cache_restart">Vidéos Canvas gardées sur ce téléphone. La nouvelle taille s\'applique au prochain démarrage de l\'app.</string>
+ <string name="settings_storage_mb">%1$d Mo</string>
+ <string name="settings_storage_gb">%1$d Go</string>
+ <string name="settings_storage_clear_cache">Vider le cache</string>
+ <string name="settings_storage_clear_cache_detail">%1$s : vidéos Canvas, pochettes et analyses AutoMix. Les téléchargements sont gardés.</string>
+ <string name="settings_storage_cleared">Cache vidé</string>
+ <string name="settings_automix_cache">Analyses AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s sur ce téléphone. Une fois vidées, les morceaux sont analysés à nouveau quand ils passent.</string>
+ <string name="settings_automix_cache_clear">Vider</string>
+ <string name="settings_automix_intro_title">Comment marche AutoMix</string>
+ <string name="settings_automix_intro_text">AutoMix mixe les morceaux que Myspoti joue lui-même : ceux des extensions, les téléchargements et les fichiers du téléphone. Les morceaux Spotify passent dans le lecteur web de Spotify, dont l\'app n\'a jamais le son : ils changent seulement en fondu.\n\nChaque morceau est analysé une fois (temps, mesures, tonalité). Les flux sont analysés en Wi-Fi, ou en données mobiles si vous l\'autorisez ; un morceau pas analysé à temps change en fondu.</string>
+ <string name="settings_automix_intro_ok">Compris</string>
+ <string name="automix_reason_spotify">Pas de mix pour l\'instant : les morceaux Spotify passent dans le lecteur web de Spotify et changent seulement en fondu.</string>
+ <string name="automix_reason_cast">Pas de mix pour l\'instant : sur un appareil Cast, les morceaux changent sans mix.</string>
+ <string name="automix_reason_podcast">Pas de mix pour l\'instant : les podcasts et livres audio commencent et finissent en entier.</string>
+ <string name="automix_reason_album">Pas de mix pour l\'instant : le morceau suivant suit celui-ci sur son album.</string>
+ <string name="automix_reason_mobile_data">Pas de mix pour l\'instant : le flux suivant n\'est pas analysé en données mobiles, il passera en fondu.</string>
+ <string name="automix_reason_frugal">Pas de mix pour l\'instant : le morceau suivant n\'a pas été analysé à temps en économie d\'énergie, il passera en fondu.</string>
+ <string name="automix_reason_not_analyzed">Pas de mix pour l\'instant : le morceau suivant n\'a pas pu être analysé à temps, il passera en fondu.</string>
</resources>
diff --git a/base/app/src/main/res/values-fr/nerd_strings.xml b/base/app/src/main/res/values-fr/nerd_strings.xml
index 3640e475..a56c6c09 100644
--- a/base/app/src/main/res/values-fr/nerd_strings.xml
+++ b/base/app/src/main/res/values-fr/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Désactivé</string>
<string name="nerd_spotify_note">Le flux Spotify est chiffré dans la page : son codec et son débit exacts ne sont pas accessibles, seulement ce que la page annonce.</string>
<string name="nerd_spotify_remote">Le son vient d’un autre appareil : ce téléphone ne fait que le commander.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Fondu calé sur le tempo</string>
+ <string name="nerd_automix_cut">Coupe sur le temps</string>
+ <string name="nerd_automix_fade">Fondu</string>
+ <string name="nerd_automix_mixing">Mix en cours : %1$s</string>
+ <string name="nerd_automix_planned">%1$s à %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">Activé, aucun mix prévu pour l\'instant</string>
</resources>
diff --git a/base/app/src/main/res/values-it/myspoti_strings.xml b/base/app/src/main/res/values-it/myspoti_strings.xml
index 04398f05..f0a69131 100644
--- a/base/app/src/main/res/values-it/myspoti_strings.xml
+++ b/base/app/src/main/res/values-it/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Artista verificato</string>
<string name="lyrics_share">Condividi il testo</string>
<string name="lyrics_extra_title">Altre fonti per i testi</string>
+ <string name="settings_section_lyrics">Testi</string>
+ <string name="settings_lyrics_romanization_detail">Sotto i versi, la canzone in caratteri latini, quando il testo la prevede</string>
+ <string name="lyrics_translation_title">Lingua di traduzione</string>
+ <string name="lyrics_translation_detail">La lingua in cui vengono tradotti i testi. Automatica: la lingua del telefono.</string>
<string name="lyrics_extra_summary">NetEase e Genius, quando Spotify non ha il testo</string>
<string name="lyrics_reload">Ricarica il testo</string>
<string name="lyrics_select_hint">Tocca le righe per scegliere cosa condividere</string>
@@ -666,6 +670,18 @@
<string name="settings_player_volume_detail">Il cursore del volume sotto i comandi. Disattivata, i tasti del volume del telefono lo regolano comunque.</string>
<string name="settings_lyrics_keep_awake_title">Schermo acceso con i testi</string>
<string name="settings_lyrics_keep_awake_detail">Finché il testo è aperto, lo schermo non si spegne da solo.</string>
+ <string name="settings_section_podcasts">Podcast</string>
+ <string name="sponsorblock_detail">Salta le letture sponsorizzate e altre parti degli episodi podcast segnalate dalla community di SponsorBlock. Chiede a sponsor.ajay.app dell\'episodio in riproduzione (e a YouTube, per trovarne il caricamento se serve); non viene inviato nulla su di te o sul tuo account.</string>
+ <string name="sponsorblock_skip_header">Parti da saltare</string>
+ <string name="sponsorblock_cat_sponsor">Sponsor</string>
+ <string name="sponsorblock_cat_sponsor_detail">Promozioni a pagamento e letture pubblicitarie</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromozione</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Merch del programma, Patreon, altri programmi</string>
+ <string name="sponsorblock_cat_intro_outro">Intro e outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Musica di apertura e chiusura, titoli di coda</string>
+ <string name="sponsorblock_cat_interaction">Promemoria</string>
+ <string name="sponsorblock_cat_interaction_detail">Inviti a seguire, valutare o iscriversi</string>
+ <string name="sponsorblock_skipped">Saltato: %1$s</string>
<string name="spatial_title">Audio spaziale</string>
<string name="spatial_enable">Allarga lo stereo</string>
<string name="spatial_detail">Elaborazione mid/side: ciò che sta ai lati viene messo in risalto, ciò che sta al centro resta dov\'è. Solo brani da estensioni, download e file locali: gli stream di Spotify non vengono elaborati. I brani mono, e tutto quando è disattivato, passano intatti.</string>
@@ -690,7 +706,7 @@
<string name="settings_automix_show">Mostra il mix nel player</string>
<string name="settings_automix_show_detail">Il tratto del mix è colorato sulla barra di avanzamento e la copertina si illumina e pulsa a tempo mentre suona.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Transizioni in stile DJ tra brani da estensioni, download e file locali: ogni brano viene analizzato una volta (battiti, battute, frasi, tonalità) e il successivo entra a tempo, con il tempo allineato e uno scambio dei bassi. I brani non sincronizzabili hanno un taglio a tempo o una dissolvenza. Gli stream vengono analizzati solo su reti senza limiti.</string>
+ <string name="settings_automix_detail">Transizioni in stile DJ tra brani da estensioni, download e file locali: ogni brano viene analizzato una volta (battiti, battute, frasi, tonalità) e il successivo entra a tempo, con il tempo allineato e uno scambio dei bassi. I brani non sincronizzabili hanno un taglio a tempo o una dissolvenza. Gli stream vengono analizzati su reti senza limiti, o con i dati mobili se lo consenti qui sotto.</string>
<string name="settings_automix_length">Durata del mix</string>
<string name="settings_automix_length_short">Breve</string>
<string name="settings_automix_length_auto">Bilanciata</string>
@@ -705,6 +721,46 @@
<string name="settings_automix_pulse">Animazione del player</string>
<string name="settings_automix_pulse_subtle">Leggera</string>
<string name="settings_automix_pulse_strong">Forte</string>
+ <string name="settings_automix_style">Stile di transizione</string>
+ <string name="settings_automix_style_blend">Mix a tempo</string>
+ <string name="settings_automix_style_cut">Taglio sul battere</string>
+ <string name="settings_automix_style_fade">Dissolvenza morbida</string>
+ <string name="settings_automix_style_detail">Il mix a tempo allinea i tempi quando può, altrimenti taglia sul battere o sfuma. Il taglio sul battere cambia brano su un primo tempo. La dissolvenza morbida sfuma senza toccare il tempo.</string>
+ <string name="settings_automix_length_detail">Breve: da 4 a 8 battute. Bilanciato: da 2 a 16, come la musica permette. Lungo: da 12 a 32 battute, fino a circa un minuto.</string>
+ <string name="settings_automix_harmonic">Mix armonico</string>
+ <string name="settings_automix_harmonic_detail">I brani in tonalità che stridono hanno mix brevi, quelli in tonalità compatibili mix lunghi. Disattivato, la tonalità è ignorata.</string>
+ <string name="settings_automix_podcasts">Mixa i podcast</string>
+ <string name="settings_automix_podcasts_detail">Disattivato, gli episodi dei podcast e gli audiolibri iniziano e finiscono interi.</string>
+ <string name="settings_automix_mobile_data">Analizza con dati mobili</string>
+ <string name="settings_automix_mobile_data_detail">I brani delle estensioni vengono analizzati anche con i dati mobili. Ognuno viene scaricato una seconda volta: circa gli stessi dati dell\'ascolto. Disattivato, solo in Wi-Fi.</string>
<string name="playback_speed_note">Velocità %1$s× · tocca per 1×</string>
<string name="jam_start_premium">Avviare una Jam richiede Spotify Premium. Puoi unirti a una con il link o il codice QR.</string>
+ <string name="settings_dynamic_color_title">Colori dinamici (Material You)</string>
+ <string name="settings_dynamic_color_detail">Il colore principale dell\'aspetto Classico viene dal tuo sfondo. L\'aspetto Immersivo mantiene i colori della copertina in riproduzione.</string>
+ <string name="settings_system_font_title">Carattere di sistema</string>
+ <string name="settings_system_font_detail">Mostra il testo dell\'app con il carattere del telefono invece di quello di Myspoti</string>
+ <string name="settings_download_lyrics_title">Scarica i testi con i brani</string>
+ <string name="settings_download_lyrics_detail">Un brano scaricato conserva il suo testo, mostrato anche senza connessione</string>
+ <string name="settings_section_storage">Spazio di archiviazione</string>
+ <string name="settings_storage_media_cache">Cache multimediale</string>
+ <string name="settings_storage_media_cache_detail">Video Canvas tenuti su questo telefono, per non scaricarli di nuovo.</string>
+ <string name="settings_storage_media_cache_restart">Video Canvas tenuti su questo telefono. La nuova dimensione vale dal prossimo avvio dell\'app.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Svuota cache</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: video Canvas, copertine e analisi AutoMix. I download restano.</string>
+ <string name="settings_storage_cleared">Cache svuotata</string>
+ <string name="settings_automix_cache">Analisi AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s su questo telefono. Svuotate, i brani vengono analizzati di nuovo quando suonano.</string>
+ <string name="settings_automix_cache_clear">Svuota</string>
+ <string name="settings_automix_intro_title">Come funziona AutoMix</string>
+ <string name="settings_automix_intro_text">AutoMix mixa i brani che Myspoti riproduce da sé: da estensioni, download e file di questo telefono. I brani Spotify suonano nel web player di Spotify, il cui audio l\'app non ha mai: cambiano solo in dissolvenza.\n\nOgni brano viene analizzato una volta (battiti, battute, tonalità). Gli stream vengono analizzati in Wi-Fi, o con i dati mobili se lo consenti; un brano non analizzato in tempo cambia in dissolvenza.</string>
+ <string name="settings_automix_intro_ok">Ho capito</string>
+ <string name="automix_reason_spotify">Nessun mix ora: i brani Spotify suonano nel web player di Spotify e cambiano solo in dissolvenza.</string>
+ <string name="automix_reason_cast">Nessun mix ora: su un dispositivo Cast i brani cambiano senza mix.</string>
+ <string name="automix_reason_podcast">Nessun mix ora: podcast e audiolibri iniziano e finiscono interi.</string>
+ <string name="automix_reason_album">Nessun mix ora: il brano successivo segue questo nel suo album.</string>
+ <string name="automix_reason_mobile_data">Nessun mix ora: lo stream successivo non viene analizzato con i dati mobili, quindi cambia in dissolvenza.</string>
+ <string name="automix_reason_frugal">Nessun mix ora: il brano successivo non è stato analizzato in tempo per il risparmio energetico, quindi cambia in dissolvenza.</string>
+ <string name="automix_reason_not_analyzed">Nessun mix ora: il brano successivo non è stato analizzato in tempo, quindi cambia in dissolvenza.</string>
</resources>
diff --git a/base/app/src/main/res/values-it/nerd_strings.xml b/base/app/src/main/res/values-it/nerd_strings.xml
index c93a6d65..8d60dd9f 100644
--- a/base/app/src/main/res/values-it/nerd_strings.xml
+++ b/base/app/src/main/res/values-it/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Disattivato</string>
<string name="nerd_spotify_note">Il flusso di Spotify è cifrato all\'interno della pagina: il suo codec e il suo bitrate esatti non sono accessibili, solo ciò che la pagina dichiara.</string>
<string name="nerd_spotify_remote">Il suono arriva da un altro dispositivo: questo telefono si limita a comandarlo.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Mix a tempo</string>
+ <string name="nerd_automix_cut">Stacco sul battito</string>
+ <string name="nerd_automix_fade">Dissolvenza</string>
+ <string name="nerd_automix_mixing">Mix in corso: %1$s</string>
+ <string name="nerd_automix_planned">%1$s a %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">Attivo, nessun mix ancora previsto</string>
</resources>
diff --git a/base/app/src/main/res/values-pl/myspoti_strings.xml b/base/app/src/main/res/values-pl/myspoti_strings.xml
index 400430ac..3ec13d23 100644
--- a/base/app/src/main/res/values-pl/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pl/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Zweryfikowany wykonawca</string>
<string name="lyrics_share">Udostępnij tekst</string>
<string name="lyrics_extra_title">Więcej źródeł tekstów</string>
+ <string name="settings_section_lyrics">Teksty</string>
+ <string name="settings_lyrics_romanization_detail">Pod wierszami piosenka w alfabecie łacińskim, gdy tekst ją ma</string>
+ <string name="lyrics_translation_title">Język tłumaczenia</string>
+ <string name="lyrics_translation_detail">Język, na który tłumaczone są teksty. Automatyczny: język telefonu.</string>
<string name="lyrics_extra_summary">NetEase i Genius, gdy Spotify nie ma tekstu</string>
<string name="lyrics_reload">Wczytaj tekst ponownie</string>
<string name="lyrics_select_hint">Stuknij wersy, aby wybrać, co udostępnić</string>
@@ -681,6 +685,18 @@
<string name="settings_player_volume_detail">Suwak głośności pod przyciskami. Wyłączony: głośność nadal ustawiają przyciski telefonu.</string>
<string name="settings_lyrics_keep_awake_title">Nie wygaszaj ekranu przy tekście</string>
<string name="settings_lyrics_keep_awake_detail">Gdy tekst jest otwarty, ekran nie wyłącza się sam.</string>
+ <string name="settings_section_podcasts">Podcasty</string>
+ <string name="sponsorblock_detail">Pomija lokowania sponsorów i inne fragmenty odcinków podcastów oznaczone przez społeczność SponsorBlock. Pyta sponsor.ajay.app o odtwarzany odcinek (i YouTube, by w razie potrzeby znaleźć jego wersję); nic o Tobie ani Twoim koncie nie jest wysyłane.</string>
+ <string name="sponsorblock_skip_header">Fragmenty do pominięcia</string>
+ <string name="sponsorblock_cat_sponsor">Sponsorzy</string>
+ <string name="sponsorblock_cat_sponsor_detail">Płatne promocje i czytane reklamy</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromocja</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Gadżety audycji, Patreon, inne audycje</string>
+ <string name="sponsorblock_cat_intro_outro">Intro i outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Muzyka na początek i koniec, napisy</string>
+ <string name="sponsorblock_cat_interaction">Przypomnienia</string>
+ <string name="sponsorblock_cat_interaction_detail">Prośby o obserwowanie, ocenę lub subskrypcję</string>
+ <string name="sponsorblock_skipped">Pominięto: %1$s</string>
<string name="spatial_title">Dźwięk przestrzenny</string>
<string name="spatial_enable">Poszerz stereo</string>
<string name="spatial_detail">Przetwarzanie mid/side: to, co po bokach, staje się wyraźniejsze, to, co w środku, zostaje na miejscu. Tylko utwory z rozszerzeń, pobrane i pliki lokalne: własne strumienie Spotify nie są przetwarzane. Utwory mono, a po wyłączeniu wszystko, przechodzą nietknięte.</string>
@@ -705,7 +721,7 @@
<string name="settings_automix_show">Pokazuj miks w odtwarzaczu</string>
<string name="settings_automix_show_detail">Fragment miksu jest pokolorowany na pasku odtwarzania, a okładka świeci i pulsuje w rytm, gdy trwa.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Przejścia w stylu DJ między utworami z rozszerzeń, pobrań i plików lokalnych: każdy utwór jest analizowany raz (bity, takty, frazy, tonacja), a następny wchodzi w rytm, z dopasowanym tempem i zamianą basu. Utwory, których nie da się zgrać, dostają cięcie w rytm albo wyciszenie. Strumienie są analizowane tylko w sieciach bez limitu.</string>
+ <string name="settings_automix_detail">Przejścia w stylu DJ między utworami z rozszerzeń, pobrań i plików lokalnych: każdy utwór jest analizowany raz (bity, takty, frazy, tonacja), a następny wchodzi w rytm, z dopasowanym tempem i zamianą basu. Utwory, których nie da się zgrać, dostają cięcie w rytm albo wyciszenie. Strumienie są analizowane w sieciach bez limitu albo przez dane mobilne, jeśli pozwolisz na to poniżej.</string>
<string name="settings_automix_length">Długość miksu</string>
<string name="settings_automix_length_short">Krótka</string>
<string name="settings_automix_length_auto">Zrównoważona</string>
@@ -720,6 +736,46 @@
<string name="settings_automix_pulse">Animacja odtwarzacza</string>
<string name="settings_automix_pulse_subtle">Delikatna</string>
<string name="settings_automix_pulse_strong">Mocna</string>
+ <string name="settings_automix_style">Styl przejścia</string>
+ <string name="settings_automix_style_blend">Miks w rytm</string>
+ <string name="settings_automix_style_cut">Cięcie na bit</string>
+ <string name="settings_automix_style_fade">Płynne przenikanie</string>
+ <string name="settings_automix_style_detail">Miks w rytm dopasowuje tempa, gdy może, a w przeciwnym razie tnie na bit lub przenika. Cięcie na bit zmienia utwór na raz taktu. Płynne przenikanie nie zmienia tempa.</string>
+ <string name="settings_automix_length_detail">Krótki: 4–8 taktów. Zrównoważony: 2–16, jak pozwala muzyka. Długi: 12–32 takty, do około minuty.</string>
+ <string name="settings_automix_harmonic">Miksowanie harmoniczne</string>
+ <string name="settings_automix_harmonic_detail">Utwory w kłócących się tonacjach dostają krótkie miksy, w zgodnych długie. Wyłączone: tonacje są pomijane.</string>
+ <string name="settings_automix_podcasts">Miksuj podcasty</string>
+ <string name="settings_automix_podcasts_detail">Wyłączone: odcinki podcastów i audiobooki zaczynają się i kończą w całości.</string>
+ <string name="settings_automix_mobile_data">Analizuj przez dane mobilne</string>
+ <string name="settings_automix_mobile_data_detail">Utwory z rozszerzeń są analizowane także przez dane mobilne. Każdy jest w tym celu pobierany drugi raz: mniej więcej tyle danych co przy słuchaniu. Wyłączone: tylko przez Wi-Fi.</string>
<string name="playback_speed_note">Prędkość %1$s× · dotknij, aby 1×</string>
<string name="jam_start_premium">Rozpoczęcie Jamu wymaga Spotify Premium. Możesz dołączyć do jednego przez link lub kod QR.</string>
+ <string name="settings_dynamic_color_title">Dynamiczne kolory (Material You)</string>
+ <string name="settings_dynamic_color_detail">Kolor akcentu wyglądu Klasycznego pochodzi z tapety. Wygląd Immersyjny zachowuje kolory odtwarzanej okładki.</string>
+ <string name="settings_system_font_title">Czcionka systemowa</string>
+ <string name="settings_system_font_detail">Wyświetla tekst aplikacji czcionką telefonu zamiast czcionki Myspoti</string>
+ <string name="settings_download_lyrics_title">Pobieraj teksty z utworami</string>
+ <string name="settings_download_lyrics_detail">Pobrany utwór zachowuje swój tekst, widoczny bez połączenia</string>
+ <string name="settings_section_storage">Pamięć</string>
+ <string name="settings_storage_media_cache">Pamięć podręczna multimediów</string>
+ <string name="settings_storage_media_cache_detail">Filmy Canvas przechowywane na tym telefonie, żeby nie pobierać ich ponownie.</string>
+ <string name="settings_storage_media_cache_restart">Filmy Canvas przechowywane na tym telefonie. Nowy rozmiar zadziała po ponownym uruchomieniu aplikacji.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Wyczyść pamięć podręczną</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: filmy Canvas, okładki i analizy AutoMix. Pobrane utwory zostają.</string>
+ <string name="settings_storage_cleared">Pamięć podręczna wyczyszczona</string>
+ <string name="settings_automix_cache">Analizy AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s na tym telefonie. Po wyczyszczeniu utwory są analizowane ponownie podczas odtwarzania.</string>
+ <string name="settings_automix_cache_clear">Wyczyść</string>
+ <string name="settings_automix_intro_title">Jak działa AutoMix</string>
+ <string name="settings_automix_intro_text">AutoMix miksuje utwory, które Myspoti odtwarza samo: z rozszerzeń, pobranych i z plików na tym telefonie. Utwory Spotify grają w odtwarzaczu internetowym Spotify, do którego dźwięku aplikacja nie ma dostępu: zmieniają się tylko z przejściem.\n\nKażdy utwór jest analizowany raz (bity, takty, tonacja). Strumienie są analizowane przez Wi-Fi albo przez dane mobilne, jeśli na to pozwolisz; utwór nieprzeanalizowany na czas zmienia się z przejściem.</string>
+ <string name="settings_automix_intro_ok">Rozumiem</string>
+ <string name="automix_reason_spotify">Teraz bez miksu: utwory Spotify grają w odtwarzaczu internetowym Spotify i zmieniają się tylko z przejściem.</string>
+ <string name="automix_reason_cast">Teraz bez miksu: na urządzeniu Cast utwory zmieniają się bez miksu.</string>
+ <string name="automix_reason_podcast">Teraz bez miksu: podcasty i audiobooki zaczynają się i kończą w całości.</string>
+ <string name="automix_reason_album">Teraz bez miksu: następny utwór idzie po tym na swoim albumie.</string>
+ <string name="automix_reason_mobile_data">Teraz bez miksu: następny strumień nie jest analizowany przez dane komórkowe, więc zmieni się z przejściem.</string>
+ <string name="automix_reason_frugal">Teraz bez miksu: następny utwór nie został przeanalizowany na czas w trybie oszczędzania energii, więc zmieni się z przejściem.</string>
+ <string name="automix_reason_not_analyzed">Teraz bez miksu: następnego utworu nie udało się przeanalizować na czas, więc zmieni się z przejściem.</string>
</resources>
diff --git a/base/app/src/main/res/values-pl/nerd_strings.xml b/base/app/src/main/res/values-pl/nerd_strings.xml
index d9af317c..847aa50c 100644
--- a/base/app/src/main/res/values-pl/nerd_strings.xml
+++ b/base/app/src/main/res/values-pl/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Wyłączone</string>
<string name="nerd_spotify_note">Strumień Spotify jest zaszyfrowany wewnątrz strony: jego dokładny kodek i przepływność są niedostępne, tylko to, co podaje strona.</string>
<string name="nerd_spotify_remote">Dźwięk pochodzi z innego urządzenia: ten telefon tylko nim steruje.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Miks zgrany z bitem</string>
+ <string name="nerd_automix_cut">Cięcie na bicie</string>
+ <string name="nerd_automix_fade">Przejście</string>
+ <string name="nerd_automix_mixing">Miksowanie: %1$s</string>
+ <string name="nerd_automix_planned">%1$s o %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">Włączony, brak zaplanowanego miksu</string>
</resources>
diff --git a/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml b/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml
index c89ebb51..8b4e210d 100644
--- a/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml
@@ -32,6 +32,11 @@
<string name="verified_artist">Artista verificado</string>
<string name="lyrics_share">Compartilhar letra</string>
<string name="lyrics_extra_title">Mais fontes de letras</string>
+ <string name="lyrics_romanization">Mostrar romanização</string>
+ <string name="settings_section_lyrics">Letras</string>
+ <string name="settings_lyrics_romanization_detail">Abaixo dos versos, a música em letras latinas, quando a letra tiver</string>
+ <string name="lyrics_translation_title">Idioma da tradução</string>
+ <string name="lyrics_translation_detail">O idioma para o qual as letras são traduzidas. Automático: o idioma do celular.</string>
<string name="lyrics_extra_summary">NetEase e Genius, quando o Spotify não tem a letra</string>
<string name="lyrics_reload">Recarregar letra</string>
<string name="lyrics_fullscreen">Abrir a letra em tela cheia</string>
@@ -644,6 +649,18 @@
<string name="settings_player_volume_detail">O controle de volume abaixo dos botões. Desativada, os botões de volume do celular continuam ajustando.</string>
<string name="settings_lyrics_keep_awake_title">Manter a tela ligada com a letra</string>
<string name="settings_lyrics_keep_awake_detail">Enquanto a letra está aberta, a tela não se apaga sozinha.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Pula as leituras de patrocínio e outras partes de episódios de podcast marcadas pela comunidade SponsorBlock. Consulta o sponsor.ajay.app sobre o episódio tocando (e o YouTube, para achar o envio dele quando preciso); nada sobre você ou sua conta é enviado.</string>
+ <string name="sponsorblock_skip_header">Partes para pular</string>
+ <string name="sponsorblock_cat_sponsor">Patrocinadores</string>
+ <string name="sponsorblock_cat_sponsor_detail">Promoções pagas e leituras de anúncio</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromoção</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Produtos do programa, Patreon, outros programas</string>
+ <string name="sponsorblock_cat_intro_outro">Intro e encerramento</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Música de abertura e de encerramento, créditos</string>
+ <string name="sponsorblock_cat_interaction">Lembretes</string>
+ <string name="sponsorblock_cat_interaction_detail">Pedidos para seguir, avaliar ou se inscrever</string>
+ <string name="sponsorblock_skipped">Pulado: %1$s</string>
<string name="spatial_title">Áudio espacial</string>
<string name="spatial_enable">Ampliar o estéreo</string>
<string name="spatial_detail">Processamento mid/side: o que está nas laterais ganha destaque, o que está no centro fica no lugar. Só músicas de extensões, downloads e arquivos locais: os streams do próprio Spotify não são processados. As músicas mono, e tudo quando está desligado, passam intactas.</string>
@@ -668,7 +685,7 @@
<string name="settings_automix_show">Mostrar a mixagem no player</string>
<string name="settings_automix_show_detail">O trecho da mixagem fica colorido na barra de reprodução, e a capa brilha e pulsa no ritmo enquanto toca.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Transições no estilo DJ entre músicas de extensões, downloads e arquivos locais: cada música é analisada uma vez (batidas, compassos, frases, tom) e a próxima entra no tempo, com o andamento igualado e uma troca de graves. As que não dá para sincronizar ganham um corte no tempo ou um fade. As transmissões só são analisadas em redes sem limite de dados.</string>
+ <string name="settings_automix_detail">Transições no estilo DJ entre músicas de extensões, downloads e arquivos locais: cada música é analisada uma vez (batidas, compassos, frases, tom) e a próxima entra no tempo, com o andamento igualado e uma troca de graves. As que não dá para sincronizar ganham um corte no tempo ou um fade. As transmissões são analisadas em redes sem limite de dados, ou com dados móveis se você permitir abaixo.</string>
<string name="settings_automix_length">Duração da mixagem</string>
<string name="settings_automix_length_short">Curta</string>
<string name="settings_automix_length_auto">Equilibrada</string>
@@ -683,6 +700,46 @@
<string name="settings_automix_pulse">Animação do player</string>
<string name="settings_automix_pulse_subtle">Suave</string>
<string name="settings_automix_pulse_strong">Forte</string>
+ <string name="settings_automix_style">Estilo de transição</string>
+ <string name="settings_automix_style_blend">Mixagem no ritmo</string>
+ <string name="settings_automix_style_cut">Corte no tempo</string>
+ <string name="settings_automix_style_fade">Fade suave</string>
+ <string name="settings_automix_style_detail">A mixagem no ritmo acerta os andamentos quando pode; senão, corta no tempo ou faz fade. O corte no tempo troca de música num primeiro tempo. O fade suave não mexe no andamento.</string>
+ <string name="settings_automix_length_detail">Curta: 4 a 8 compassos. Equilibrada: 2 a 16, conforme a música. Longa: 12 a 32 compassos, até cerca de um minuto.</string>
+ <string name="settings_automix_harmonic">Mixagem harmônica</string>
+ <string name="settings_automix_harmonic_detail">Músicas em tons que não combinam têm mixagens curtas; em tons compatíveis, longas. Desativada, o tom é ignorado.</string>
+ <string name="settings_automix_podcasts">Mixar podcasts</string>
+ <string name="settings_automix_podcasts_detail">Desativado, os episódios de podcast e os audiolivros começam e terminam inteiros.</string>
+ <string name="settings_automix_mobile_data">Analisar com dados móveis</string>
+ <string name="settings_automix_mobile_data_detail">As músicas das extensões também são analisadas com dados móveis. Cada uma é baixada uma segunda vez para isso: mais ou menos os mesmos dados que ao ouvi-la. Desativado, só no Wi-Fi.</string>
<string name="playback_speed_note">Velocidade %1$s× · toque para 1×</string>
<string name="jam_start_premium">Iniciar uma Jam exige Spotify Premium. Você pode entrar em uma pelo link ou QR code.</string>
+ <string name="settings_dynamic_color_title">Cores dinâmicas (Material You)</string>
+ <string name="settings_dynamic_color_detail">A cor de destaque do visual Classic vem do seu papel de parede. O visual Immersive mantém as cores da capa tocando.</string>
+ <string name="settings_system_font_title">Fonte do sistema</string>
+ <string name="settings_system_font_detail">Mostra o texto do app com a fonte do seu celular em vez da do Myspoti</string>
+ <string name="settings_download_lyrics_title">Baixar letras com as músicas</string>
+ <string name="settings_download_lyrics_detail">Uma música baixada guarda a letra, exibida sem conexão</string>
+ <string name="settings_section_storage">Armazenamento</string>
+ <string name="settings_storage_media_cache">Cache de mídia</string>
+ <string name="settings_storage_media_cache_detail">Vídeos Canvas guardados neste celular, para não serem baixados de novo.</string>
+ <string name="settings_storage_media_cache_restart">Vídeos Canvas guardados neste celular. O novo tamanho vale a partir da próxima abertura do app.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Limpar cache</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: vídeos Canvas, capas e análises do AutoMix. Os downloads são mantidos.</string>
+ <string name="settings_storage_cleared">Cache limpo</string>
+ <string name="settings_automix_cache">Análises do AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s neste celular. Limpas, as músicas são analisadas de novo quando tocam.</string>
+ <string name="settings_automix_cache_clear">Limpar</string>
+ <string name="settings_automix_intro_title">Como o AutoMix funciona</string>
+ <string name="settings_automix_intro_text">O AutoMix mixa as músicas que o próprio Myspoti toca: de extensões, downloads e arquivos deste celular. As músicas do Spotify tocam no player web do Spotify, cujo som o app nunca tem: elas só mudam com um fade.\n\nCada música é analisada uma vez (batidas, compassos, tom). Os streams são analisados no Wi-Fi, ou com dados móveis se você permitir; uma música não analisada a tempo muda com um fade.</string>
+ <string name="settings_automix_intro_ok">Entendi</string>
+ <string name="automix_reason_spotify">Sem mixagem agora: as músicas do Spotify tocam no player web do Spotify e só mudam com um fade.</string>
+ <string name="automix_reason_cast">Sem mixagem agora: em um dispositivo Cast as músicas mudam sem mixagem.</string>
+ <string name="automix_reason_podcast">Sem mixagem agora: podcasts e audiolivros começam e terminam inteiros.</string>
+ <string name="automix_reason_album">Sem mixagem agora: a próxima música vem depois desta no álbum.</string>
+ <string name="automix_reason_mobile_data">Sem mixagem agora: o próximo stream não é analisado nos dados móveis, então muda com um fade.</string>
+ <string name="automix_reason_frugal">Sem mixagem agora: a próxima música não foi analisada a tempo por causa da economia de energia, então muda com um fade.</string>
+ <string name="automix_reason_not_analyzed">Sem mixagem agora: a próxima música não pôde ser analisada a tempo, então muda com um fade.</string>
</resources>
diff --git a/base/app/src/main/res/values-pt-rBR/nerd_strings.xml b/base/app/src/main/res/values-pt-rBR/nerd_strings.xml
index 8a0dc0fc..709ed8f4 100644
--- a/base/app/src/main/res/values-pt-rBR/nerd_strings.xml
+++ b/base/app/src/main/res/values-pt-rBR/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Desligado</string>
<string name="nerd_spotify_note">O stream do Spotify é criptografado dentro da página: seu codec e taxa de bits exatos não são acessíveis, apenas o que a página informa.</string>
<string name="nerd_spotify_remote">O som vem de outro dispositivo: este celular apenas o controla.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Mixagem no tempo</string>
+ <string name="nerd_automix_cut">Corte na batida</string>
+ <string name="nerd_automix_fade">Fade</string>
+ <string name="nerd_automix_mixing">Mixando: %1$s</string>
+ <string name="nerd_automix_planned">%1$s em %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">Ativado, nenhuma mixagem prevista ainda</string>
</resources>
diff --git a/base/app/src/main/res/values-pt-rPT/myspoti_strings.xml b/base/app/src/main/res/values-pt-rPT/myspoti_strings.xml
index e2d1375d..e79ce355 100644
--- a/base/app/src/main/res/values-pt-rPT/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pt-rPT/myspoti_strings.xml
@@ -31,6 +31,10 @@
<string name="verified_artist">Artista verificado</string>
<string name="lyrics_share">Partilhar letras</string>
<string name="lyrics_extra_title">Mais fontes de letras</string>
+ <string name="settings_section_lyrics">Letras</string>
+ <string name="settings_lyrics_romanization_detail">Por baixo dos versos, a música em letras latinas, quando a letra a tem</string>
+ <string name="lyrics_translation_title">Idioma da tradução</string>
+ <string name="lyrics_translation_detail">O idioma para o qual as letras são traduzidas. Automático: o idioma do telemóvel.</string>
<string name="lyrics_extra_summary">NetEase e Genius, quando o Spotify não tem as letras</string>
<string name="lyrics_reload">Recarregar as letras</string>
<string name="lyrics_select_hint">Toque nas linhas para escolher o que partilhar</string>
@@ -612,6 +616,18 @@
<string name="settings_player_volume_detail">O controlo de volume por baixo dos botões. Desativada, os botões de volume do telemóvel continuam a ajustá-lo.</string>
<string name="settings_lyrics_keep_awake_title">Manter o ecrã ligado com a letra</string>
<string name="settings_lyrics_keep_awake_detail">Enquanto a letra está aberta, o ecrã não se desliga sozinho.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Salta as leituras de patrocínio e outras partes de episódios de podcast marcadas pela comunidade SponsorBlock. Pergunta ao sponsor.ajay.app sobre o episódio em reprodução (e ao YouTube, para encontrar o seu envio quando necessário); nada sobre si ou a sua conta é enviado.</string>
+ <string name="sponsorblock_skip_header">Partes a saltar</string>
+ <string name="sponsorblock_cat_sponsor">Patrocinadores</string>
+ <string name="sponsorblock_cat_sponsor_detail">Promoções pagas e leituras de anúncios</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromoção</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Produtos do programa, Patreon, outros programas</string>
+ <string name="sponsorblock_cat_intro_outro">Intro e outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Música de abertura e de fecho, créditos</string>
+ <string name="sponsorblock_cat_interaction">Lembretes</string>
+ <string name="sponsorblock_cat_interaction_detail">Pedidos para seguir, avaliar ou subscrever</string>
+ <string name="sponsorblock_skipped">Saltado: %1$s</string>
<string name="spatial_title">Áudio espacial</string>
<string name="spatial_enable">Alargar o estéreo</string>
<string name="spatial_detail">Processamento mid/side: o que está nos lados ganha destaque, o que está ao centro fica no lugar. Só músicas de extensões, transferências e ficheiros locais: os streams do próprio Spotify não são processados. As músicas mono, e tudo quando está desligado, passam intactas.</string>
@@ -636,7 +652,7 @@
<string name="settings_automix_show">Mostrar a mistura no leitor</string>
<string name="settings_automix_show_detail">O trecho da mistura é colorido na barra de reprodução, e a capa brilha e pulsa ao ritmo enquanto toca.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Transições ao estilo DJ entre músicas de extensões, transferências e ficheiros locais: cada música é analisada uma vez (batidas, compassos, frases, tonalidade) e a seguinte entra no tempo, com o andamento igualado e uma troca de graves. As que não podem ser sincronizadas têm um corte no tempo ou um fade. As transmissões só são analisadas em redes sem limite de dados.</string>
+ <string name="settings_automix_detail">Transições ao estilo DJ entre músicas de extensões, transferências e ficheiros locais: cada música é analisada uma vez (batidas, compassos, frases, tonalidade) e a seguinte entra no tempo, com o andamento igualado e uma troca de graves. As que não podem ser sincronizadas têm um corte no tempo ou um fade. As transmissões são analisadas em redes sem limite de dados, ou com dados móveis se o permitir abaixo.</string>
<string name="settings_automix_length">Duração da mistura</string>
<string name="settings_automix_length_short">Curta</string>
<string name="settings_automix_length_auto">Equilibrada</string>
@@ -651,6 +667,46 @@
<string name="settings_automix_pulse">Animação do leitor</string>
<string name="settings_automix_pulse_subtle">Suave</string>
<string name="settings_automix_pulse_strong">Forte</string>
+ <string name="settings_automix_style">Estilo de transição</string>
+ <string name="settings_automix_style_blend">Mistura no ritmo</string>
+ <string name="settings_automix_style_cut">Corte no tempo</string>
+ <string name="settings_automix_style_fade">Fade suave</string>
+ <string name="settings_automix_style_detail">A mistura no ritmo acerta os andamentos quando pode; senão, corta no tempo ou faz fade. O corte no tempo troca de música num primeiro tempo. O fade suave não mexe no andamento.</string>
+ <string name="settings_automix_length_detail">Curta: 4 a 8 compassos. Equilibrada: 2 a 16, conforme a música. Longa: 12 a 32 compassos, até cerca de um minuto.</string>
+ <string name="settings_automix_harmonic">Mistura harmónica</string>
+ <string name="settings_automix_harmonic_detail">Músicas em tons que chocam têm misturas curtas; em tons compatíveis, longas. Desativada, o tom é ignorado.</string>
+ <string name="settings_automix_podcasts">Misturar podcasts</string>
+ <string name="settings_automix_podcasts_detail">Desativado, os episódios de podcast e os audiolivros começam e acabam inteiros.</string>
+ <string name="settings_automix_mobile_data">Analisar com dados móveis</string>
+ <string name="settings_automix_mobile_data_detail">As músicas das extensões também são analisadas com dados móveis. Cada uma é transferida uma segunda vez para isso: mais ou menos os mesmos dados que ao ouvi-la. Desativado, só em Wi-Fi.</string>
<string name="playback_speed_note">Velocidade %1$s× · toque para 1×</string>
<string name="jam_start_premium">Iniciar uma Jam requer Spotify Premium. Pode juntar-se a uma com a ligação ou o código QR.</string>
+ <string name="settings_dynamic_color_title">Cores dinâmicas (Material You)</string>
+ <string name="settings_dynamic_color_detail">A cor de destaque do visual Clássico vem do teu fundo de ecrã. O visual Imersivo mantém as cores da capa em reprodução.</string>
+ <string name="settings_system_font_title">Tipo de letra do sistema</string>
+ <string name="settings_system_font_detail">Mostra o texto da app com o tipo de letra do telemóvel em vez do do Myspoti</string>
+ <string name="settings_download_lyrics_title">Transferir letras com as músicas</string>
+ <string name="settings_download_lyrics_detail">Uma música transferida guarda a sua letra, mostrada sem ligação</string>
+ <string name="settings_section_storage">Armazenamento</string>
+ <string name="settings_storage_media_cache">Cache multimédia</string>
+ <string name="settings_storage_media_cache_detail">Vídeos Canvas guardados neste telemóvel, para não serem transferidos de novo.</string>
+ <string name="settings_storage_media_cache_restart">Vídeos Canvas guardados neste telemóvel. O novo tamanho aplica-se no próximo arranque da app.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Limpar cache</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: vídeos Canvas, capas e análises do AutoMix. As transferências são mantidas.</string>
+ <string name="settings_storage_cleared">Cache limpa</string>
+ <string name="settings_automix_cache">Análises do AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s neste telemóvel. Limpas, as músicas são analisadas de novo quando tocam.</string>
+ <string name="settings_automix_cache_clear">Limpar</string>
+ <string name="settings_automix_intro_title">Como funciona o AutoMix</string>
+ <string name="settings_automix_intro_text">O AutoMix mistura as músicas que o próprio Myspoti toca: de extensões, transferências e ficheiros deste telemóvel. As músicas do Spotify tocam no leitor web do Spotify, cujo som a app nunca tem: só mudam com um desvanecimento.\n\nCada música é analisada uma vez (batidas, compassos, tom). As emissões são analisadas em Wi-Fi, ou com dados móveis se o permitir; uma música não analisada a tempo muda com um desvanecimento.</string>
+ <string name="settings_automix_intro_ok">Entendido</string>
+ <string name="automix_reason_spotify">Sem mistura agora: as músicas do Spotify tocam no leitor web do Spotify e só mudam com um desvanecimento.</string>
+ <string name="automix_reason_cast">Sem mistura agora: num dispositivo Cast as músicas mudam sem mistura.</string>
+ <string name="automix_reason_podcast">Sem mistura agora: podcasts e audiolivros começam e terminam inteiros.</string>
+ <string name="automix_reason_album">Sem mistura agora: a próxima música vem depois desta no seu álbum.</string>
+ <string name="automix_reason_mobile_data">Sem mistura agora: a próxima emissão não é analisada com dados móveis, por isso muda com um desvanecimento.</string>
+ <string name="automix_reason_frugal">Sem mistura agora: a próxima música não foi analisada a tempo por causa da poupança de energia, por isso muda com um desvanecimento.</string>
+ <string name="automix_reason_not_analyzed">Sem mistura agora: a próxima música não pôde ser analisada a tempo, por isso muda com um desvanecimento.</string>
</resources>
diff --git a/base/app/src/main/res/values-pt/myspoti_strings.xml b/base/app/src/main/res/values-pt/myspoti_strings.xml
index 348a7006..a70296ae 100644
--- a/base/app/src/main/res/values-pt/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pt/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Artista verificado</string>
<string name="lyrics_share">Compartilhar letras</string>
<string name="lyrics_extra_title">Mais fontes de letras</string>
+ <string name="settings_section_lyrics">Letras</string>
+ <string name="settings_lyrics_romanization_detail">Por baixo dos versos, a música em letras latinas, quando a letra a tem</string>
+ <string name="lyrics_translation_title">Idioma da tradução</string>
+ <string name="lyrics_translation_detail">O idioma para o qual as letras são traduzidas. Automático: o idioma do celular.</string>
<string name="lyrics_extra_summary">NetEase e Genius, quando o Spotify não tem as letras</string>
<string name="lyrics_reload">Recarregar as letras</string>
<string name="lyrics_select_hint">Toque nas linhas para escolher o que compartilhar</string>
@@ -666,6 +670,18 @@
<string name="settings_player_volume_detail">O controlo de volume por baixo dos botões. Desativada, os botões de volume do telemóvel continuam a ajustá-lo.</string>
<string name="settings_lyrics_keep_awake_title">Manter o ecrã ligado com a letra</string>
<string name="settings_lyrics_keep_awake_detail">Enquanto a letra está aberta, o ecrã não se desliga sozinho.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_detail">Salta as leituras de patrocínio e outras partes de episódios de podcast marcadas pela comunidade SponsorBlock. Pergunta ao sponsor.ajay.app sobre o episódio em reprodução (e ao YouTube, para encontrar o seu envio quando necessário); nada sobre si ou a sua conta é enviado.</string>
+ <string name="sponsorblock_skip_header">Partes a saltar</string>
+ <string name="sponsorblock_cat_sponsor">Patrocinadores</string>
+ <string name="sponsorblock_cat_sponsor_detail">Promoções pagas e leituras de anúncios</string>
+ <string name="sponsorblock_cat_selfpromo">Autopromoção</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Produtos do programa, Patreon, outros programas</string>
+ <string name="sponsorblock_cat_intro_outro">Intro e outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Música de abertura e de fecho, créditos</string>
+ <string name="sponsorblock_cat_interaction">Lembretes</string>
+ <string name="sponsorblock_cat_interaction_detail">Pedidos para seguir, avaliar ou subscrever</string>
+ <string name="sponsorblock_skipped">Saltado: %1$s</string>
<string name="spatial_title">Áudio espacial</string>
<string name="spatial_enable">Alargar o estéreo</string>
<string name="spatial_detail">Processamento mid/side: o que está nos lados ganha destaque, o que está ao centro fica no lugar. Só músicas de extensões, transferências e ficheiros locais: os streams do próprio Spotify não são processados. As músicas mono, e tudo quando está desligado, passam intactas.</string>
@@ -690,7 +706,7 @@
<string name="settings_automix_show">Mostrar a mistura no leitor</string>
<string name="settings_automix_show_detail">O trecho da mistura é colorido na barra de reprodução, e a capa brilha e pulsa ao ritmo enquanto toca.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Transições ao estilo DJ entre músicas de extensões, transferências e ficheiros locais: cada música é analisada uma vez (batidas, compassos, frases, tonalidade) e a seguinte entra no tempo, com o andamento igualado e uma troca de graves. As que não podem ser sincronizadas têm um corte no tempo ou um fade. As transmissões só são analisadas em redes sem limite de dados.</string>
+ <string name="settings_automix_detail">Transições ao estilo DJ entre músicas de extensões, transferências e ficheiros locais: cada música é analisada uma vez (batidas, compassos, frases, tonalidade) e a seguinte entra no tempo, com o andamento igualado e uma troca de graves. As que não podem ser sincronizadas têm um corte no tempo ou um fade. As transmissões são analisadas em redes sem limite de dados, ou com dados móveis se o permitir abaixo.</string>
<string name="settings_automix_length">Duração da mistura</string>
<string name="settings_automix_length_short">Curta</string>
<string name="settings_automix_length_auto">Equilibrada</string>
@@ -705,6 +721,46 @@
<string name="settings_automix_pulse">Animação do leitor</string>
<string name="settings_automix_pulse_subtle">Suave</string>
<string name="settings_automix_pulse_strong">Forte</string>
+ <string name="settings_automix_style">Estilo de transição</string>
+ <string name="settings_automix_style_blend">Mistura no ritmo</string>
+ <string name="settings_automix_style_cut">Corte no tempo</string>
+ <string name="settings_automix_style_fade">Fade suave</string>
+ <string name="settings_automix_style_detail">A mistura no ritmo acerta os andamentos quando pode; senão, corta no tempo ou faz fade. O corte no tempo troca de música num primeiro tempo. O fade suave não mexe no andamento.</string>
+ <string name="settings_automix_length_detail">Curta: 4 a 8 compassos. Equilibrada: 2 a 16, conforme a música. Longa: 12 a 32 compassos, até cerca de um minuto.</string>
+ <string name="settings_automix_harmonic">Mistura harmónica</string>
+ <string name="settings_automix_harmonic_detail">Músicas em tons que chocam têm misturas curtas; em tons compatíveis, longas. Desativada, o tom é ignorado.</string>
+ <string name="settings_automix_podcasts">Misturar podcasts</string>
+ <string name="settings_automix_podcasts_detail">Desativado, os episódios de podcast e os audiolivros começam e acabam inteiros.</string>
+ <string name="settings_automix_mobile_data">Analisar com dados móveis</string>
+ <string name="settings_automix_mobile_data_detail">As músicas das extensões também são analisadas com dados móveis. Cada uma é transferida uma segunda vez para isso: mais ou menos os mesmos dados que ao ouvi-la. Desativado, só em Wi-Fi.</string>
<string name="playback_speed_note">Velocidade %1$s× · toque para 1×</string>
<string name="jam_start_premium">Iniciar uma Jam requer Spotify Premium. Pode juntar-se a uma com a ligação ou o código QR.</string>
+ <string name="settings_dynamic_color_title">Cores dinâmicas (Material You)</string>
+ <string name="settings_dynamic_color_detail">A cor de destaque do visual Clássico vem do teu fundo de ecrã. O visual Imersivo mantém as cores da capa em reprodução.</string>
+ <string name="settings_system_font_title">Tipo de letra do sistema</string>
+ <string name="settings_system_font_detail">Mostra o texto da app com o tipo de letra do telemóvel em vez do do Myspoti</string>
+ <string name="settings_download_lyrics_title">Transferir letras com as músicas</string>
+ <string name="settings_download_lyrics_detail">Uma música transferida guarda a sua letra, mostrada sem ligação</string>
+ <string name="settings_section_storage">Armazenamento</string>
+ <string name="settings_storage_media_cache">Cache de mídia</string>
+ <string name="settings_storage_media_cache_detail">Vídeos Canvas guardados neste celular, para não serem baixados de novo.</string>
+ <string name="settings_storage_media_cache_restart">Vídeos Canvas guardados neste celular. O novo tamanho aplica-se no próximo arranque da app.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Limpar cache</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: vídeos Canvas, capas e análises do AutoMix. Os downloads são mantidos.</string>
+ <string name="settings_storage_cleared">Cache limpa</string>
+ <string name="settings_automix_cache">Análises do AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s neste celular. Limpas, as músicas são analisadas de novo quando tocam.</string>
+ <string name="settings_automix_cache_clear">Limpar</string>
+ <string name="settings_automix_intro_title">Como funciona o AutoMix</string>
+ <string name="settings_automix_intro_text">O AutoMix mistura as músicas que o próprio Myspoti toca: de extensões, downloads e ficheiros deste celular. As músicas do Spotify tocam no leitor web do Spotify, cujo som a app nunca tem: só mudam com um fade.\n\nCada música é analisada uma vez (batidas, compassos, tom). Os streams são analisados em Wi-Fi, ou com dados móveis se o permitir; uma música não analisada a tempo muda com um fade.</string>
+ <string name="settings_automix_intro_ok">Entendido</string>
+ <string name="automix_reason_spotify">Sem mistura agora: as músicas do Spotify tocam no leitor web do Spotify e só mudam com um fade.</string>
+ <string name="automix_reason_cast">Sem mistura agora: num dispositivo Cast as músicas mudam sem mistura.</string>
+ <string name="automix_reason_podcast">Sem mistura agora: podcasts e audiolivros começam e terminam inteiros.</string>
+ <string name="automix_reason_album">Sem mistura agora: a próxima música vem depois desta no seu álbum.</string>
+ <string name="automix_reason_mobile_data">Sem mistura agora: o próximo stream não é analisado com dados móveis, por isso muda com um fade.</string>
+ <string name="automix_reason_frugal">Sem mistura agora: a próxima música não foi analisada a tempo por causa da poupança de energia, por isso muda com um fade.</string>
+ <string name="automix_reason_not_analyzed">Sem mistura agora: a próxima música não pôde ser analisada a tempo, por isso muda com um fade.</string>
</resources>
diff --git a/base/app/src/main/res/values-pt/nerd_strings.xml b/base/app/src/main/res/values-pt/nerd_strings.xml
index 297b78c4..0caf985f 100644
--- a/base/app/src/main/res/values-pt/nerd_strings.xml
+++ b/base/app/src/main/res/values-pt/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Desligado</string>
<string name="nerd_spotify_note">O stream do Spotify é criptografado dentro da página: seu codec e taxa de bits exatos não são acessíveis, apenas o que a página informa.</string>
<string name="nerd_spotify_remote">O som vem de outro dispositivo: este celular apenas o controla.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Mistura no tempo</string>
+ <string name="nerd_automix_cut">Corte na batida</string>
+ <string name="nerd_automix_fade">Fade</string>
+ <string name="nerd_automix_mixing">Misturando: %1$s</string>
+ <string name="nerd_automix_planned">%1$s em %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">Ativado, nenhuma mistura prevista ainda</string>
</resources>
diff --git a/base/app/src/main/res/values-ru/myspoti_strings.xml b/base/app/src/main/res/values-ru/myspoti_strings.xml
index dab6b3ed..6d73283f 100644
--- a/base/app/src/main/res/values-ru/myspoti_strings.xml
+++ b/base/app/src/main/res/values-ru/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Подтверждённый исполнитель</string>
<string name="lyrics_share">Поделиться текстом</string>
<string name="lyrics_extra_title">Другие источники текстов</string>
+ <string name="settings_section_lyrics">Текст песен</string>
+ <string name="settings_lyrics_romanization_detail">Под строками песня латиницей, если она есть в тексте</string>
+ <string name="lyrics_translation_title">Язык перевода</string>
+ <string name="lyrics_translation_detail">Язык, на который переводятся тексты. Автоматически: язык телефона.</string>
<string name="lyrics_extra_summary">NetEase и Genius, когда в Spotify нет текста</string>
<string name="lyrics_reload">Загрузить текст заново</string>
<string name="lyrics_select_hint">Нажимайте на строки, чтобы выбрать, чем поделиться</string>
@@ -681,6 +685,18 @@
<string name="settings_player_volume_detail">Ползунок громкости под кнопками. Если выключено, громкость по-прежнему меняют кнопки телефона.</string>
<string name="settings_lyrics_keep_awake_title">Не гасить экран с текстом песни</string>
<string name="settings_lyrics_keep_awake_detail">Пока открыт текст песни, экран не гаснет сам.</string>
+ <string name="settings_section_podcasts">Подкасты</string>
+ <string name="sponsorblock_detail">Пропускает спонсорские вставки и другие части выпусков подкастов, отмеченные сообществом SponsorBlock. Запрашивает у sponsor.ajay.app данные о текущем выпуске (и у YouTube, чтобы при необходимости найти его загрузку); ничего о вас и вашем аккаунте не отправляется.</string>
+ <string name="sponsorblock_skip_header">Что пропускать</string>
+ <string name="sponsorblock_cat_sponsor">Спонсоры</string>
+ <string name="sponsorblock_cat_sponsor_detail">Платная реклама и рекламные вставки</string>
+ <string name="sponsorblock_cat_selfpromo">Самореклама</string>
+ <string name="sponsorblock_cat_selfpromo_detail">Мерч шоу, Patreon, другие шоу</string>
+ <string name="sponsorblock_cat_intro_outro">Вступление и концовка</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Музыка в начале и в конце, титры</string>
+ <string name="sponsorblock_cat_interaction">Напоминания</string>
+ <string name="sponsorblock_cat_interaction_detail">Просьбы подписаться, оценить или отслеживать</string>
+ <string name="sponsorblock_skipped">Пропущено: %1$s</string>
<string name="spatial_title">Пространственный звук</string>
<string name="spatial_enable">Расширить стерео</string>
<string name="spatial_detail">Обработка mid/side: то, что звучит по бокам, выходит вперёд, то, что в центре, остаётся на месте. Только песни из расширений, загрузки и локальные файлы: собственные потоки Spotify не обрабатываются. Моно-песни, а в выключенном состоянии и всё остальное, проходят нетронутыми.</string>
@@ -705,7 +721,7 @@
<string name="settings_automix_show">Показывать сведение в плеере</string>
<string name="settings_automix_show_detail">Участок сведения выделен цветом на полосе воспроизведения, а обложка светится и пульсирует в такт, пока оно идёт.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">Переходы в стиле диджея между треками из расширений, загрузок и локальных файлов: каждый трек анализируется один раз (доли, такты, фразы, тональность), и следующий вступает в такт, с выровненным темпом и сменой баса. Треки, которые нельзя свести, получают склейку в такт или затухание. Потоки анализируются только в безлимитных сетях.</string>
+ <string name="settings_automix_detail">Переходы в стиле диджея между треками из расширений, загрузок и локальных файлов: каждый трек анализируется один раз (доли, такты, фразы, тональность), и следующий вступает в такт, с выровненным темпом и сменой баса. Треки, которые нельзя свести, получают склейку в такт или затухание. Потоки анализируются в безлимитных сетях или по мобильной сети, если вы разрешите это ниже.</string>
<string name="settings_automix_length">Длина сведения</string>
<string name="settings_automix_length_short">Короткая</string>
<string name="settings_automix_length_auto">Сбалансированная</string>
@@ -720,6 +736,46 @@
<string name="settings_automix_pulse">Анимация плеера</string>
<string name="settings_automix_pulse_subtle">Слабая</string>
<string name="settings_automix_pulse_strong">Сильная</string>
+ <string name="settings_automix_style">Стиль перехода</string>
+ <string name="settings_automix_style_blend">Сведение в такт</string>
+ <string name="settings_automix_style_cut">Склейка на сильную долю</string>
+ <string name="settings_automix_style_fade">Плавное затухание</string>
+ <string name="settings_automix_style_detail">Сведение в такт подгоняет темпы, когда может, иначе склеивает на сильную долю или делает затухание. Склейка меняет трек на первой доле такта. Плавное затухание не меняет темп.</string>
+ <string name="settings_automix_length_detail">Короткий: 4–8 тактов. Сбалансированный: 2–16, как позволяет музыка. Длинный: 12–32 такта, примерно до минуты.</string>
+ <string name="settings_automix_harmonic">Гармоническое сведение</string>
+ <string name="settings_automix_harmonic_detail">Треки в несовместимых тональностях сводятся коротко, в совместимых — долго. Выключено: тональность не учитывается.</string>
+ <string name="settings_automix_podcasts">Сводить подкасты</string>
+ <string name="settings_automix_podcasts_detail">Выключено: выпуски подкастов и аудиокниги начинаются и заканчиваются целиком.</string>
+ <string name="settings_automix_mobile_data">Анализ по мобильной сети</string>
+ <string name="settings_automix_mobile_data_detail">Треки из расширений анализируются и по мобильной сети. Каждый для этого скачивается второй раз: примерно столько же трафика, сколько при прослушивании. Выключено: только по Wi-Fi.</string>
<string name="playback_speed_note">Скорость %1$s× · нажмите для 1×</string>
<string name="jam_start_premium">Чтобы начать Jam, нужен Spotify Premium. Присоединиться можно по ссылке или QR-коду.</string>
+ <string name="settings_dynamic_color_title">Динамические цвета (Material You)</string>
+ <string name="settings_dynamic_color_detail">Акцентный цвет оформления «Классическое» берётся из обоев. Оформление «Иммерсивное» сохраняет цвета текущей обложки.</string>
+ <string name="settings_system_font_title">Системный шрифт</string>
+ <string name="settings_system_font_detail">Показывает текст приложения шрифтом телефона вместо шрифта Myspoti</string>
+ <string name="settings_download_lyrics_title">Скачивать тексты вместе с треками</string>
+ <string name="settings_download_lyrics_detail">Скачанный трек сохраняет свой текст, который виден без подключения</string>
+ <string name="settings_section_storage">Хранилище</string>
+ <string name="settings_storage_media_cache">Медиакэш</string>
+ <string name="settings_storage_media_cache_detail">Видео Canvas, сохранённые на этом телефоне, чтобы не скачивать их заново.</string>
+ <string name="settings_storage_media_cache_restart">Видео Canvas, сохранённые на этом телефоне. Новый размер применится при следующем запуске приложения.</string>
+ <string name="settings_storage_mb">%1$d МБ</string>
+ <string name="settings_storage_gb">%1$d ГБ</string>
+ <string name="settings_storage_clear_cache">Очистить кэш</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: видео Canvas, обложки и анализы AutoMix. Загрузки сохраняются.</string>
+ <string name="settings_storage_cleared">Кэш очищен</string>
+ <string name="settings_automix_cache">Анализы AutoMix</string>
+ <string name="settings_automix_cache_detail">%1$s на этом телефоне. После очистки треки анализируются заново при воспроизведении.</string>
+ <string name="settings_automix_cache_clear">Очистить</string>
+ <string name="settings_automix_intro_title">Как работает AutoMix</string>
+ <string name="settings_automix_intro_text">AutoMix сводит треки, которые Myspoti играет сам: из расширений, загрузок и файлов на этом телефоне. Треки Spotify играют в веб-плеере Spotify, звук которого приложению недоступен: они сменяются только плавным переходом.\n\nКаждый трек анализируется один раз (доли, такты, тональность). Потоки анализируются по Wi-Fi или по мобильной сети, если вы это разрешите; трек, не проанализированный вовремя, сменяется плавным переходом.</string>
+ <string name="settings_automix_intro_ok">Понятно</string>
+ <string name="automix_reason_spotify">Сейчас без сведения: треки Spotify играют в веб-плеере Spotify и сменяются только плавным переходом.</string>
+ <string name="automix_reason_cast">Сейчас без сведения: на устройстве Cast треки сменяются без сведения.</string>
+ <string name="automix_reason_podcast">Сейчас без сведения: подкасты и аудиокниги начинаются и заканчиваются целиком.</string>
+ <string name="automix_reason_album">Сейчас без сведения: следующий трек идёт за этим на своём альбоме.</string>
+ <string name="automix_reason_mobile_data">Сейчас без сведения: следующий поток не анализируется по мобильной сети, поэтому сменится плавным переходом.</string>
+ <string name="automix_reason_frugal">Сейчас без сведения: следующий трек не успел проанализироваться из-за энергосбережения, поэтому сменится плавным переходом.</string>
+ <string name="automix_reason_not_analyzed">Сейчас без сведения: следующий трек не удалось проанализировать вовремя, поэтому сменится плавным переходом.</string>
</resources>
diff --git a/base/app/src/main/res/values-ru/nerd_strings.xml b/base/app/src/main/res/values-ru/nerd_strings.xml
index 30524641..431c0ea1 100644
--- a/base/app/src/main/res/values-ru/nerd_strings.xml
+++ b/base/app/src/main/res/values-ru/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">Выключено</string>
<string name="nerd_spotify_note">Поток Spotify зашифрован внутри страницы: его точные кодек и битрейт недоступны, только то, что сообщает страница.</string>
<string name="nerd_spotify_remote">Звук идёт с другого устройства: этот телефон только управляет им.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Сведение по битам</string>
+ <string name="nerd_automix_cut">Склейка на долю</string>
+ <string name="nerd_automix_fade">Плавный переход</string>
+ <string name="nerd_automix_mixing">Сводится: %1$s</string>
+ <string name="nerd_automix_planned">%1$s в %2$s, %3$d с</string>
+ <string name="nerd_automix_waiting">Включён, сведение пока не запланировано</string>
</resources>
diff --git a/base/app/src/main/res/values-zh/myspoti_strings.xml b/base/app/src/main/res/values-zh/myspoti_strings.xml
index 57eb6cab..6ff5bf4a 100644
--- a/base/app/src/main/res/values-zh/myspoti_strings.xml
+++ b/base/app/src/main/res/values-zh/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">认证艺人</string>
<string name="lyrics_share">分享歌词</string>
<string name="lyrics_extra_title">更多歌词来源</string>
+ <string name="settings_section_lyrics">歌词</string>
+ <string name="settings_lyrics_romanization_detail">歌词行下方的罗马音(歌词提供时)</string>
+ <string name="lyrics_translation_title">翻译语言</string>
+ <string name="lyrics_translation_detail">歌词翻译成的语言。自动:手机的语言。</string>
<string name="lyrics_extra_summary">Spotify 没有歌词时使用 NetEase 和 Genius</string>
<string name="lyrics_reload">重新加载歌词</string>
<string name="lyrics_select_hint">点按歌词行以选择要分享的内容</string>
@@ -666,6 +670,18 @@
<string name="settings_player_volume_detail">控制按钮下方的音量滑块。关闭后,仍可用手机的音量键调节。</string>
<string name="settings_lyrics_keep_awake_title">显示歌词时保持屏幕常亮</string>
<string name="settings_lyrics_keep_awake_detail">歌词打开时,屏幕不会自动关闭。</string>
+ <string name="settings_section_podcasts">播客</string>
+ <string name="sponsorblock_detail">跳过 SponsorBlock 社区标记的播客节目赞助口播及其他片段。会向 sponsor.ajay.app 查询正在播放的节目(必要时也会通过 YouTube 查找其上传版本);不会发送任何关于你或你账号的信息。</string>
+ <string name="sponsorblock_skip_header">要跳过的部分</string>
+ <string name="sponsorblock_cat_sponsor">赞助</string>
+ <string name="sponsorblock_cat_sponsor_detail">付费推广和广告口播</string>
+ <string name="sponsorblock_cat_selfpromo">自我推广</string>
+ <string name="sponsorblock_cat_selfpromo_detail">节目周边、Patreon、其他节目</string>
+ <string name="sponsorblock_cat_intro_outro">片头和片尾</string>
+ <string name="sponsorblock_cat_intro_outro_detail">开场和结束音乐、致谢</string>
+ <string name="sponsorblock_cat_interaction">提醒</string>
+ <string name="sponsorblock_cat_interaction_detail">请求关注、评分或订阅</string>
+ <string name="sponsorblock_skipped">已跳过:%1$s</string>
<string name="spatial_title">空间音频</string>
<string name="spatial_enable">扩展立体声</string>
<string name="spatial_detail">中/侧声道处理:两侧的声音更突出,中间的声音保持不动。仅适用于来自扩展、下载和本地文件的歌曲:Spotify 自己的音频流不会被处理。单声道歌曲,以及关闭时的所有声音,均原样通过。</string>
@@ -690,7 +706,7 @@
<string name="settings_automix_show">在播放器中显示混音</string>
<string name="settings_automix_show_detail">混音段在进度条上以颜色标出,混音时封面会随节拍发光和律动。</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">在扩展、下载和本地文件的歌曲之间进行 DJ 式过渡:每首歌只分析一次(节拍、小节、乐句、调性),下一首在节拍上进入,速度对齐并交换低音。无法对拍的歌曲会在节拍上切换或淡变。串流仅在不计流量的网络上分析。</string>
+ <string name="settings_automix_detail">在扩展、下载和本地文件的歌曲之间进行 DJ 式过渡:每首歌只分析一次(节拍、小节、乐句、调性),下一首在节拍上进入,速度对齐并交换低音。无法对拍的歌曲会在节拍上切换或淡变。串流在不计流量的网络上分析,如你在下方允许,也可使用移动数据。</string>
<string name="settings_automix_length">混音时长</string>
<string name="settings_automix_length_short">短</string>
<string name="settings_automix_length_auto">均衡</string>
@@ -705,6 +721,46 @@
<string name="settings_automix_pulse">播放器动画</string>
<string name="settings_automix_pulse_subtle">轻微</string>
<string name="settings_automix_pulse_strong">强烈</string>
+ <string name="settings_automix_style">过渡风格</string>
+ <string name="settings_automix_style_blend">节拍混音</string>
+ <string name="settings_automix_style_cut">踩拍切换</string>
+ <string name="settings_automix_style_fade">平滑淡入淡出</string>
+ <string name="settings_automix_style_detail">节拍混音在可行时对齐速度,否则踩拍切换或淡入淡出。踩拍切换在强拍上换歌。平滑淡入淡出不改变速度。</string>
+ <string name="settings_automix_length_detail">短:4 到 8 小节。均衡:2 到 16 小节,视音乐而定。长:12 到 32 小节,最长约一分钟。</string>
+ <string name="settings_automix_harmonic">和声混音</string>
+ <string name="settings_automix_harmonic_detail">调性冲突的歌曲混音较短,调性相合的较长。关闭时忽略调性。</string>
+ <string name="settings_automix_podcasts">混音播客</string>
+ <string name="settings_automix_podcasts_detail">关闭时,播客单集和有声书完整播放,不做混音。</string>
+ <string name="settings_automix_mobile_data">使用移动数据分析</string>
+ <string name="settings_automix_mobile_data_detail">扩展中的歌曲在移动数据下也会分析。每首歌为此要再下载一次:流量约等于再播放一遍。关闭时仅在 Wi-Fi 下分析。</string>
<string name="playback_speed_note">速度 %1$s× · 点按恢复 1×</string>
<string name="jam_start_premium">发起 Jam 需要 Spotify Premium。你可以通过链接或二维码加入。</string>
+ <string name="settings_dynamic_color_title">动态取色 (Material You)</string>
+ <string name="settings_dynamic_color_detail">经典外观的强调色取自你的壁纸。沉浸式外观保留正在播放的封面颜色。</string>
+ <string name="settings_system_font_title">系统字体</string>
+ <string name="settings_system_font_detail">用手机的字体显示应用文字,而不是 Myspoti 自带的字体</string>
+ <string name="settings_download_lyrics_title">下载歌曲时一并下载歌词</string>
+ <string name="settings_download_lyrics_detail">已下载的歌曲会保留歌词,无网络时也能显示</string>
+ <string name="settings_section_storage">存储空间</string>
+ <string name="settings_storage_media_cache">媒体缓存</string>
+ <string name="settings_storage_media_cache_detail">保存在此手机上的 Canvas 视频,避免重复下载。</string>
+ <string name="settings_storage_media_cache_restart">保存在此手机上的 Canvas 视频。新大小将在应用下次启动时生效。</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">清除缓存</string>
+ <string name="settings_storage_clear_cache_detail">%1$s:Canvas 视频、封面和 AutoMix 分析。下载内容会保留。</string>
+ <string name="settings_storage_cleared">缓存已清除</string>
+ <string name="settings_automix_cache">AutoMix 分析</string>
+ <string name="settings_automix_cache_detail">此手机上占用 %1$s。清除后,歌曲播放时会重新分析。</string>
+ <string name="settings_automix_cache_clear">清除</string>
+ <string name="settings_automix_intro_title">AutoMix 如何工作</string>
+ <string name="settings_automix_intro_text">AutoMix 会混音 Myspoti 自己播放的歌曲:来自扩展、下载和此手机上的文件。Spotify 歌曲在 Spotify 网页播放器中播放,应用无法获得其声音:它们只会淡入淡出。\n\n每首歌曲只分析一次(节拍、小节、调性)。流媒体在 Wi-Fi 下分析,如你允许也可使用移动数据;未及时分析的歌曲会以淡入淡出切换。</string>
+ <string name="settings_automix_intro_ok">知道了</string>
+ <string name="automix_reason_spotify">暂不混音:Spotify 歌曲在 Spotify 网页播放器中播放,只会淡入淡出。</string>
+ <string name="automix_reason_cast">暂不混音:在 Cast 设备上,歌曲切换时不混音。</string>
+ <string name="automix_reason_podcast">暂不混音:播客和有声书完整开始和结束。</string>
+ <string name="automix_reason_album">暂不混音:下一首歌曲在专辑中紧接这一首。</string>
+ <string name="automix_reason_mobile_data">暂不混音:使用移动数据时不分析下一个流,因此将淡入淡出。</string>
+ <string name="automix_reason_frugal">暂不混音:节能模式下下一首歌曲未能及时分析,因此将淡入淡出。</string>
+ <string name="automix_reason_not_analyzed">暂不混音:下一首歌曲未能及时分析,因此将淡入淡出。</string>
</resources>
diff --git a/base/app/src/main/res/values-zh/nerd_strings.xml b/base/app/src/main/res/values-zh/nerd_strings.xml
index 4ca90c38..c80dc1af 100644
--- a/base/app/src/main/res/values-zh/nerd_strings.xml
+++ b/base/app/src/main/res/values-zh/nerd_strings.xml
@@ -54,4 +54,11 @@
<string name="nerd_mirror_off">关</string>
<string name="nerd_spotify_note">Spotify 的流在页面内加密:无法获取其确切的编解码器和比特率,只能看到页面声明的内容。</string>
<string name="nerd_spotify_remote">声音来自另一台设备:此手机只负责控制它。</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">节拍对齐混音</string>
+ <string name="nerd_automix_cut">节拍切换</string>
+ <string name="nerd_automix_fade">淡入淡出</string>
+ <string name="nerd_automix_mixing">正在混音:%1$s</string>
+ <string name="nerd_automix_planned">%1$s 于 %2$s,%3$d 秒</string>
+ <string name="nerd_automix_waiting">已开启,暂未安排混音</string>
</resources>
diff --git a/base/app/src/main/res/values/myspoti_strings.xml b/base/app/src/main/res/values/myspoti_strings.xml
index 7cd2c9e0..aaa56e3d 100644
--- a/base/app/src/main/res/values/myspoti_strings.xml
+++ b/base/app/src/main/res/values/myspoti_strings.xml
@@ -32,6 +32,10 @@
<string name="verified_artist">Verified Artist</string>
<string name="lyrics_share">Share lyrics</string>
<string name="lyrics_extra_title">More lyrics sources</string>
+ <string name="settings_section_lyrics">Lyrics</string>
+ <string name="settings_lyrics_romanization_detail">Under the lines, the song in Latin letters, when the lyrics have it</string>
+ <string name="lyrics_translation_title">Translation language</string>
+ <string name="lyrics_translation_detail">The language the lyrics are translated into. Automatic: the phone\'s language.</string>
<string name="lyrics_extra_summary">NetEase and Genius, when Spotify has no lyrics</string>
<string name="lyrics_reload">Reload lyrics</string>
<string name="lyrics_select_hint">Tap lines to pick what to share</string>
@@ -401,7 +405,7 @@
<string name="myspoti_shuffle_detail">With shuffle on, a playlist, album or Liked Songs plays every song once, in a random order, before starting over. Off: Spotify\'s shuffle. A free account may keep Spotify\'s shuffle on some lists.</string>
<string name="myspoti_shuffle_imposed">Spotify keeps its own shuffle on this list for your account: Myspoti shuffle is off for it.</string>
<string name="settings_automix_title">AutoMix</string>
- <string name="settings_automix_detail">DJ-style transitions between songs from extensions, downloads and local files: each song is analysed once (beats, bars, phrases, key) and the next one comes in on the beat, tempo matched, with a bass swap. Songs that cannot be beat-matched get a cut on the beat or a fade. Streams are analysed on unmetered networks only.</string>
+ <string name="settings_automix_detail">DJ-style transitions between songs from extensions, downloads and local files: each song is analysed once (beats, bars, phrases, key) and the next one comes in on the beat, tempo matched, with a bass swap. Songs that cannot be beat-matched get a cut on the beat or a fade. Streams are analysed on unmetered networks, or on mobile data if you allow it below.</string>
<string name="settings_crossfade_title">Crossfade</string>
<string name="settings_crossfade_detail">Songs from extensions, downloads and local files overlap: the end of one fades out while the next fades in. Spotify streams cannot overlap (one audio stream): they only fade out and in.</string>
<string name="settings_crossfade_off">Off</string>
@@ -674,6 +678,19 @@
<string name="settings_player_volume_detail">The volume slider under the controls. Off, the phone\'s volume buttons still set it.</string>
<string name="settings_lyrics_keep_awake_title">Keep the screen on with lyrics</string>
<string name="settings_lyrics_keep_awake_detail">While the lyrics are open, the screen does not turn off by itself.</string>
+ <string name="settings_section_podcasts">Podcasts</string>
+ <string name="sponsorblock_title" translatable="false">SponsorBlock</string>
+ <string name="sponsorblock_detail">Skips sponsor reads and other parts of podcast episodes marked by the SponsorBlock community. Asks sponsor.ajay.app about the episode playing (and YouTube, to find its upload when needed); nothing about you or your account is sent.</string>
+ <string name="sponsorblock_skip_header">Parts to skip</string>
+ <string name="sponsorblock_cat_sponsor">Sponsors</string>
+ <string name="sponsorblock_cat_sponsor_detail">Paid promotions and ad reads</string>
+ <string name="sponsorblock_cat_selfpromo">Self-promotion</string>
+ <string name="sponsorblock_cat_selfpromo_detail">The show\'s merch, Patreon, other shows</string>
+ <string name="sponsorblock_cat_intro_outro">Intro and outro</string>
+ <string name="sponsorblock_cat_intro_outro_detail">Opening and closing music, credits</string>
+ <string name="sponsorblock_cat_interaction">Reminders</string>
+ <string name="sponsorblock_cat_interaction_detail">Asking to follow, rate or subscribe</string>
+ <string name="sponsorblock_skipped">Skipped: %1$s</string>
<string name="spatial_title">Spatial audio</string>
<string name="spatial_enable">Widen the stereo</string>
<string name="spatial_detail">Mid/side processing: what sits at the sides is brought out, what sits in the middle stays put. Songs from extensions, downloads and local files only: Spotify\'s own streams are not processed. Mono songs, and everything when off, pass untouched.</string>
@@ -711,6 +728,46 @@
<string name="settings_automix_pulse">Player animation</string>
<string name="settings_automix_pulse_subtle">Subtle</string>
<string name="settings_automix_pulse_strong">Strong</string>
+ <string name="settings_automix_style">Transition style</string>
+ <string name="settings_automix_style_blend">Beat blend</string>
+ <string name="settings_automix_style_cut">Cut on the beat</string>
+ <string name="settings_automix_style_fade">Smooth fade</string>
+ <string name="settings_automix_style_detail">Beat blend matches the tempos where it can, else cuts on the beat or fades. Cut on the beat switches songs on a downbeat. Smooth fade fades without touching the tempo.</string>
+ <string name="settings_automix_length_detail">Short: 4 to 8 bars. Balanced: 2 to 16, as the music allows. Long: 12 to 32 bars, up to about a minute.</string>
+ <string name="settings_automix_harmonic">Harmonic mixing</string>
+ <string name="settings_automix_harmonic_detail">Songs in clashing keys get short mixes, matching keys long ones. Off, keys are ignored.</string>
+ <string name="settings_automix_podcasts">Mix podcasts</string>
+ <string name="settings_automix_podcasts_detail">Off, podcast episodes and audiobooks start and end whole.</string>
+ <string name="settings_automix_mobile_data">Analyse on mobile data</string>
+ <string name="settings_automix_mobile_data_detail">Songs from extensions are analysed on mobile data too. Each is downloaded a second time for it: about as much data again as playing it. Off, on Wi-Fi only.</string>
<string name="playback_speed_note">Speed %1$s× · tap for 1×</string>
<string name="jam_start_premium">Starting a Jam needs Spotify Premium. You can join one with its link or QR code.</string>
+ <string name="settings_dynamic_color_title">Dynamic colors (Material You)</string>
+ <string name="settings_dynamic_color_detail">The Classic look\'s accent comes from your wallpaper. The Immersive look keeps the colors of the playing cover.</string>
+ <string name="settings_system_font_title">System font</string>
+ <string name="settings_system_font_detail">Shows the app\'s text in your phone\'s font instead of Myspoti\'s own</string>
+ <string name="settings_download_lyrics_title">Download lyrics with songs</string>
+ <string name="settings_download_lyrics_detail">A downloaded song keeps its lyrics, shown without a connection</string>
+ <string name="settings_section_storage">Storage</string>
+ <string name="settings_storage_media_cache">Media cache</string>
+ <string name="settings_storage_media_cache_detail">Canvas videos kept on this phone, so they are not downloaded again.</string>
+ <string name="settings_storage_media_cache_restart">Canvas videos kept on this phone. The new size applies when the app starts again.</string>
+ <string name="settings_storage_mb">%1$d MB</string>
+ <string name="settings_storage_gb">%1$d GB</string>
+ <string name="settings_storage_clear_cache">Clear cache</string>
+ <string name="settings_storage_clear_cache_detail">%1$s: Canvas videos, covers and AutoMix analyses. Downloads are kept.</string>
+ <string name="settings_storage_cleared">Cache cleared</string>
+ <string name="settings_automix_cache">AutoMix analyses</string>
+ <string name="settings_automix_cache_detail">%1$s on this phone. Cleared, songs are analysed again when they play.</string>
+ <string name="settings_automix_cache_clear">Clear</string>
+ <string name="settings_automix_intro_title">How AutoMix works</string>
+ <string name="settings_automix_intro_text">AutoMix mixes the songs Myspoti plays itself: from extensions, downloads and files on this phone. Spotify songs play in Spotify\'s web player, whose sound the app never has: they only fade.\n\nEach song is analysed once (beats, bars, key). Streams are analysed on Wi-Fi, or on mobile data if you allow it; a song not analysed in time changes with a fade.</string>
+ <string name="settings_automix_intro_ok">Got it</string>
+ <string name="automix_reason_spotify">No mix now: Spotify songs play in Spotify\'s web player and only fade.</string>
+ <string name="automix_reason_cast">No mix now: songs on a Cast device change without a mix.</string>
+ <string name="automix_reason_podcast">No mix now: podcasts and audiobooks start and end whole.</string>
+ <string name="automix_reason_album">No mix now: the next song follows this one on its album.</string>
+ <string name="automix_reason_mobile_data">No mix now: the next stream is not analysed on mobile data, so it fades.</string>
+ <string name="automix_reason_frugal">No mix now: the next song was not analysed in time while saving energy, so it fades.</string>
+ <string name="automix_reason_not_analyzed">No mix now: the next song could not be analysed in time, so it fades.</string>
</resources>
diff --git a/base/app/src/main/res/values/nerd_strings.xml b/base/app/src/main/res/values/nerd_strings.xml
index b084f74e..378f2fd3 100644
--- a/base/app/src/main/res/values/nerd_strings.xml
+++ b/base/app/src/main/res/values/nerd_strings.xml
@@ -55,4 +55,11 @@
<string name="nerd_mirror_off">Off</string>
<string name="nerd_spotify_note">The Spotify stream is encrypted inside the page: its exact codec and bit rate are not accessible, only what the page announces.</string>
<string name="nerd_spotify_remote">The sound comes from another device: this phone only commands it.</string>
+ <string name="nerd_automix">AutoMix</string>
+ <string name="nerd_automix_blend">Beat-matched blend</string>
+ <string name="nerd_automix_cut">Cut on the beat</string>
+ <string name="nerd_automix_fade">Fade</string>
+ <string name="nerd_automix_mixing">Mixing now: %1$s</string>
+ <string name="nerd_automix_planned">%1$s at %2$s, %3$d s</string>
+ <string name="nerd_automix_waiting">On, no mix planned yet</string>
</resources>
diff --git a/base/app/src/test/java/com/music/spotui/data/api/LyricsKeptTest.kt b/base/app/src/test/java/com/music/spotui/data/api/LyricsKeptTest.kt
new file mode 100644
index 00000000..6666ab0e
--- /dev/null
+++ b/base/app/src/test/java/com/music/spotui/data/api/LyricsKeptTest.kt
@@ -0,0 +1,21 @@
+package com.music.spotui.data.api
+
+import com.music.spotui.data.entity.LyricLine
+import com.music.spotui.data.entity.Lyrics
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+class LyricsKeptTest {
+ private val lines = listOf(LyricLine(0, "a"), LyricLine(1_000, "b"))
+
+ @Test fun syncedAndPlainLyricsAreKeptWithADownload() {
+ assertTrue(LyricsApi.keepable(Lyrics(lines, synced = true)))
+ assertTrue(LyricsApi.keepable(Lyrics(lines, synced = false)))
+ }
+
+ @Test fun aFreePreviewOrNothingIsNotKept() {
+ assertFalse(LyricsApi.keepable(Lyrics(lines, synced = true, uncapped = false)))
+ assertFalse(LyricsApi.keepable(Lyrics(emptyList(), synced = true)))
+ }
+}
diff --git a/base/app/src/test/java/com/music/spotui/data/offline/OfflineIndexTest.kt b/base/app/src/test/java/com/music/spotui/data/offline/OfflineIndexTest.kt
index a1f36c94..68b3f628 100644
--- a/base/app/src/test/java/com/music/spotui/data/offline/OfflineIndexTest.kt
+++ b/base/app/src/test/java/com/music/spotui/data/offline/OfflineIndexTest.kt
@@ -82,4 +82,19 @@ class OfflineIndexTest {
assertFalse(File(root, "audio/b.m4a").exists())
assertTrue(File(root, "audio/a.m4a").exists())
}
+
+ @Test fun lyricsKeptWithDownloadsFollowTheIndex() {
+ val root = folder(JSONArray().put(entry("a")).toString(), "a")
+ File(root, "lyrics").mkdirs()
+ File(root, "lyrics/a.json").writeText("{}"); File(root, "lyrics/gone.json").writeText("{}")
+ OfflineStore.load(root)
+ assertEquals(File(root, "lyrics/a.json"), OfflineStore.lyricsFile("a"))
+ assertTrue(File(root, "lyrics/a.json").exists())
+ assertFalse(File(root, "lyrics/gone.json").exists())
+ // No file for an id unfit for a name (an episode's "episode:<id>", a path).
+ assertEquals(null, OfflineStore.lyricsFile("episode:x"))
+ assertEquals(null, OfflineStore.lyricsFile("../a"))
+ assertEquals(null, OfflineStore.lyricsFile(""))
+ root.deleteRecursively()
+ }
}
diff --git a/base/app/src/test/java/com/music/spotui/podcast/SponsorSegmentsTest.kt b/base/app/src/test/java/com/music/spotui/podcast/SponsorSegmentsTest.kt
new file mode 100644
index 00000000..863e456b
--- /dev/null
+++ b/base/app/src/test/java/com/music/spotui/podcast/SponsorSegmentsTest.kt
@@ -0,0 +1,108 @@
+package com.music.spotui.podcast
+
+import com.music.spotui.podcast.SponsorSegments.Segment
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertNull
+import org.junit.Assert.assertTrue
+import org.junit.Test
+
+class SponsorSegmentsTest {
+ private val all = SponsorSegments.ALL_CATEGORIES.toSet()
+
+ @Test fun hashPrefixIsTheFirstFourHexOfSha256() {
+ // The server answered prefix 800 with this episode (service=Spotify), 2026-11-03.
+ assertEquals("8004", SponsorSegments.hashPrefix("1asgl8mRtVJhZFF1zYZQvZ"))
+ }
+
+ @Test fun parseKeepsOnlyTheEpisodesSkipSegments() {
+ // Shape of a real answer of /api/skipSegments/800?service=Spotify, trimmed.
+ val body = """[{"videoID":"1asgl8mRtVJhZFF1zYZQvZ","segments":[
+ {"category":"sponsor","actionType":"skip","segment":[0,76.974],"UUID":"a","videoDuration":4458.26,"locked":0,"votes":0,"description":""},
+ {"category":"sponsor","actionType":"full","segment":[0,0],"UUID":"b","videoDuration":4458.26}]},
+ {"videoID":"2KLAgmjeelP9WPTbC2wpW3","segments":[{"category":"sponsor","actionType":"skip","segment":[860.238,1019.027],"UUID":"c","videoDuration":5242.551}]}]"""
+ assertEquals(listOf(Segment(0, 76_974, "sponsor", "a", 4_458_260)), SponsorSegments.parse(body, "1asgl8mRtVJhZFF1zYZQvZ"))
+ assertEquals(emptyList<Segment>(), SponsorSegments.parse(body, "other"))
+ assertNull(SponsorSegments.parse("Hash prefix does not match format requirements.", "x"))
+ }
+
+ @Test fun segmentsOfACopyOfAnotherLengthAreLeftOut() {
+ val s = listOf(
+ Segment(10_000, 40_000, "sponsor", "a", 600_000),
+ Segment(100_000, 130_000, "sponsor", "b", 660_000), // marked on a copy one minute longer
+ Segment(200_000, 230_000, "sponsor", "c", 0), // length not given: kept
+ )
+ assertEquals(listOf("a", "c"), SponsorSegments.usable(s, 601_500, all).map { it.uuid })
+ }
+
+ @Test fun onlyTheChosenCategoriesAreKept() {
+ val s = listOf(Segment(0, 20_000, "intro", "i"), Segment(50_000, 80_000, "sponsor", "s"), Segment(90_000, 95_000, "selfpromo", "p"))
+ assertEquals(listOf("s"), SponsorSegments.usable(s, 0, setOf("sponsor")).map { it.uuid })
+ }
+
+ @Test fun overlappingSegmentsAreMergedAndTinyOnesDropped() {
+ val s = listOf(
+ Segment(50_000, 80_000, "sponsor", "a"),
+ Segment(80_500, 90_000, "selfpromo", "b"),
+ Segment(120_000, 120_400, "sponsor", "tiny"),
+ )
+ val u = SponsorSegments.usable(s, 0, all)
+ assertEquals(1, u.size)
+ assertEquals(50_000L, u[0].startMs)
+ assertEquals(90_000L, u[0].endMs)
+ }
+
+ @Test fun aSegmentEndsWithTheEpisode() {
+ val u = SponsorSegments.usable(listOf(Segment(500_000, 700_000, "outro", "o", 0)), 600_000, all)
+ assertEquals(600_000L, u.single().endMs)
+ }
+
+ @Test fun theSameEpisodeOnYouTubeIsAccepted() {
+ assertTrue(SponsorSegments.matches("#412 – The Future of Sleep", "The Huberman Hour", 3_600_000,
+ "The Future of Sleep | The Huberman Hour #412", "Huberman Hour", 3_601))
+ }
+
+ @Test fun anotherLengthIsRefused() {
+ // A clip, or the video edit with its own ad reads: the segments would land elsewhere.
+ assertFalse(SponsorSegments.matches("The Future of Sleep", "The Huberman Hour", 3_600_000,
+ "The Future of Sleep | The Huberman Hour", "Huberman Hour", 3_610))
+ }
+
+ @Test fun anotherEpisodeOfTheShowIsRefused() {
+ assertFalse(SponsorSegments.matches("The Future of Sleep", "The Huberman Hour", 3_600_000,
+ "Why We Dream | The Huberman Hour", "Huberman Hour", 3_600))
+ }
+
+ @Test fun withoutTheShowOnlyAFullLongTitleIsTrusted() {
+ assertFalse(SponsorSegments.matches("Episode 12", "Some Show", 1_800_000, "Episode 12", "Random channel", 1_800))
+ assertTrue(SponsorSegments.matches("Why cities flood every spring", "Some Show", 1_800_000,
+ "Why Cities Flood Every Spring", "Random channel", 1_800))
+ }
+
+ @Test fun bestPicksTheClosestMatch() {
+ val hits = listOf(
+ Triple("Why We Dream | Huberman Hour", "Huberman Hour", 3_600L),
+ Triple("The Future of Sleep - Huberman Hour (full)", "Huberman Hour", 3_599L),
+ Triple("The Future of Sleep | Huberman Hour", "Huberman Hour", 3_600L),
+ )
+ assertEquals(2, SponsorSegments.best("The Future of Sleep", "Huberman Hour", 3_600_200, hits))
+ assertEquals(-1, SponsorSegments.best("Something else entirely", "Huberman Hour", 3_600_200, hits))
+ }
+
+ @Test fun eachSegmentIsSkippedOnce() {
+ val t = SkipTracker(listOf(Segment(10_000, 40_000, "sponsor", "a"), Segment(100_000, 130_000, "sponsor", "b")))
+ assertNull(t.due(5_000))
+ assertEquals("a", t.due(10_200)?.uuid)
+ // The Undo goes back into it: it plays.
+ assertNull(t.due(10_200))
+ assertNull(t.due(20_000))
+ assertEquals(60_000L, t.untilNext(40_000))
+ assertEquals("b", t.due(100_300)?.uuid)
+ assertNull(t.untilNext(131_000))
+ }
+
+ @Test fun aSegmentAboutToEndIsLetEnd() {
+ val t = SkipTracker(listOf(Segment(10_000, 40_000, "sponsor", "a")))
+ assertNull(t.due(39_000))
+ }
+}
diff --git a/base/automix/src/main/kotlin/app/myspoti/automix/MixPlanner.kt b/base/automix/src/main/kotlin/app/myspoti/automix/MixPlanner.kt
index 410dea17..fcb84417 100644
--- a/base/automix/src/main/kotlin/app/myspoti/automix/MixPlanner.kt
+++ b/base/automix/src/main/kotlin/app/myspoti/automix/MixPlanner.kt
@@ -15,13 +15,15 @@ import kotlin.math.roundToInt
* mix lasts and its style.
*
* Rules (from DJ practice, Mixxx's intro/outro model and Zehren et al. 2020 on cue points):
- * - Cues sit on downbeats, preferably on 8-bar phrase starts; the mix lasts 2 to 16 bars.
+ * - Cues sit on downbeats, preferably on 8-bar phrase starts; the mix lasts 2 to 32 bars
+ * ([Settings.minBars] to [Settings.maxBars]).
* - A goes out in its outro: late, where its level drops, without cutting a loud part short.
* - B comes in at its first downbeat (or a later phrase start within its intro), and its first big
* change (the drop, the first verse) should land when A is gone.
* - Beat-matching only with clear grids on both sides and a tempo change within [Settings.maxStretch]
* (half and double time count); keys a fifth apart or more and two voices at once shorten the mix.
* - Otherwise a cut on A's downbeat (A has a grid) or a plain fade.
+ * The listener may ask for one style ([Settings.style]): always a cut on the beat, or always a fade.
*/
object MixPlanner {
class Settings(
@@ -31,24 +33,40 @@ object MixPlanner {
val maxSec: Double = 32.0,
/** Fade length without a beat grid, seconds. */
val fadeSec: Double = 6.0,
- /** The listener's taste for mix length: -1 short (2 to 8 bars), 0 as scored, 1 long (12 to 16 bars). */
+ /** The listener's taste for mix length: -1 short, 0 as scored, 1 long (a lean within [minBars]..[maxBars]). */
val lengthBias: Int = 0,
+ /**
+ * The style asked for: [MixPlan.Style.BLEND] beat-matched where it can (a cut or a fade
+ * otherwise), [MixPlan.Style.CUT] always a cut on A's downbeat (a fade when A has no grid),
+ * [MixPlan.Style.FADE] always a plain equal-power fade of [smoothSec], tempos untouched.
+ */
+ val style: MixPlan.Style = MixPlan.Style.BLEND,
+ /** Shortest blend wanted, bars: a shorter one only when no longer one fits (each halving costs a lot). */
+ val minBars: Int = 2,
+ /** Longest blend, bars (2 to 32). */
+ val maxBars: Int = 16,
+ /** Weight of the key distance (Camelot) in a blend's score: 0 ignores the keys, 2 harmonic mixing. */
+ val keyWeight: Double = 1.0,
+ /** Length of the fade when the listener asks for fades ([style] FADE), seconds. */
+ val smoothSec: Double = 8.0,
)
fun plan(a: TrackAnalysis, b: TrackAnalysis, s: Settings = Settings()): MixPlan {
+ if (s.style == MixPlan.Style.FADE) return fade(a, b, "smooth fade asked", s.smoothSec)
val ga = a.tail; val gb = b.head
val match = if (ga != null && gb != null && !a.tailDown.isNaN() && !b.headDown.isNaN()) tempoMatch(ga.bpm, gb.bpm) else null
- if (match != null && abs(match.speed - 1) <= s.maxStretch) {
+ if (s.style == MixPlan.Style.BLEND && match != null && abs(match.speed - 1) <= s.maxStretch) {
blend(a, b, ga!!, gb!!, match, s)?.let { return it }
}
if (ga != null && !a.tailDown.isNaN()) cut(a, b, ga, gb, match, s)?.let { return it }
- return fade(a, b, s, if (match == null) "no beat grid" else String.format("tempo %.1f → %.1f too far", ga!!.bpm, gb!!.bpm))
+ return fade(a, b, if (match == null) "no beat grid" else String.format("tempo %.1f → %.1f too far", ga!!.bpm, gb!!.bpm), s.fadeSec)
}
/**
* The mix for a skip (the user pressed Next at A's time [now]; the next song can be heard [lead]
* seconds later at the earliest): short, from A's next downbeat. Two bars beat-matched (one when
* two are over 5.5 s), else a cut on the downbeat, else a 2.5 s fade. Either analysis may be missing.
+ * The style asked for holds: no blend with CUT, a 2.5 s fade with FADE.
*/
fun planSkip(a: TrackAnalysis?, b: TrackAnalysis?, now: Double, lead: Double, s: Settings = Settings()): MixPlan {
val from = now + lead
@@ -56,11 +74,11 @@ object MixPlanner {
val gb = b?.head?.takeIf { !b.headDown.isNaN() }
val entry = if (b != null && gb != null) firstDown(gb, b.headDown, b.contentStart - 0.08) else b?.contentStart ?: 0.0
val gain = if (a != null && b != null) matchGain(a, b) else 1.0
- if (a != null && ga != null) {
+ if (a != null && ga != null && s.style != MixPlan.Style.FADE) {
val exit = firstDown(ga.first, ga.second, from)
val barA = 4 * ga.first.period
val m = gb?.let { tempoMatch(ga.first.bpm, it.bpm) }
- if (m != null && abs(m.speed - 1) <= s.maxStretch) {
+ if (s.style == MixPlan.Style.BLEND && m != null && abs(m.speed - 1) <= s.maxStretch) {
val bars = if (2 * barA <= 5.5) 2 else 1
return MixPlan(MixPlan.Style.BLEND, exit, entry, bars * barA, m.speed, bars * 4, 0.5, 1.0 / (bars * 4), gain,
restore(m.speed, gb.period), String.format("skip: %d bar(s) from A's downbeat at %.1f, %.1f→%.1f BPM", bars, exit, ga.first.bpm, gb.bpm))
@@ -68,7 +86,8 @@ object MixPlanner {
return MixPlan(MixPlan.Style.CUT, exit, entry, 2 * ga.first.period, 1.0, 2, 0.0, 0.5, gain, 0.0,
String.format("skip: cut on A's downbeat at %.1f", exit))
}
- return MixPlan(MixPlan.Style.FADE, from, entry, 2.5, 1.0, 0, 0.5, 0.1, gain, 0.0, "skip: fade (no beat grid here)")
+ return MixPlan(MixPlan.Style.FADE, from, entry, 2.5, 1.0, 0, 0.5, 0.1, gain, 0.0,
+ if (s.style == MixPlan.Style.FADE) "skip: fade" else "skip: fade (no beat grid here)")
}
/** The grid (and one of its downbeats) holding at A's time [t]: the tail's near the end, the head's near the start, the one grid of a steady song. */
@@ -93,9 +112,10 @@ object MixPlanner {
val entries = entryCues(b, gb)
if (exits.isEmpty() || entries.isEmpty()) return null
val keyPenalty = keyDistance(a, b)
+ val lengths = BARS.filter { it <= max(2, s.maxBars) }
var best: MixPlan? = null; var bestScore = Double.NEGATIVE_INFINITY
val drops = drops(b, gb)
- for (e in exits) for (bars in intArrayOf(16, 12, 8, 6, 4, 2)) for (n in entries + dropEntries(b, gb, drops, bars * barA * m.speed)) {
+ for (e in exits) for (bars in lengths) for (n in entries + dropEntries(b, gb, drops, bars * barA * m.speed)) {
val len = bars * barA
if (len > s.maxSec + 0.01 && bars > 2) continue
// A must still be playing (its audible part) for most of the mix.
@@ -105,10 +125,13 @@ object MixPlanner {
// The whole mix where both grids were checked (a grid of a song's first 25 s holds there only).
if (bEnd > gb.last + gb.period || n.time < gb.first - gb.period || e.time < ga.first - ga.period) continue
var score = e.score + n.score
- // Long mixes suit songs in compatible keys with steady grids; clashing keys favour short ones.
- score += when (bars) { 16 -> 1.0; 12 -> 0.6; 8 -> 1.5; 6 -> 0.4; 4 -> 0.8; else -> 0.0 } - keyPenalty * bars / 8.0
- // The listener's taste: a lean towards short or long mixes (strong enough to win over the defaults).
- score += s.lengthBias * (bars - 8) / 8.0 * 1.6
+ // Long mixes suit songs in compatible keys with steady grids; clashing keys favour short ones
+ // (as much as the listener weighs the keys: not at all without harmonic mixing).
+ score += when (bars) { 32 -> 0.6; 24 -> 0.3; 16 -> 1.0; 12 -> 0.6; 8 -> 1.5; 6 -> 0.4; 4 -> 0.8; else -> 0.0 } - keyPenalty * s.keyWeight * bars / 8.0
+ // The listener's taste: a lean towards short or long mixes (strong enough to win over the defaults),
+ // and below the shortest length asked for, a cost that only a mix that fits nothing longer pays.
+ score += s.lengthBias * ((min(bars, 16) - 8) / 8.0 + max(0, bars - 16) / 16.0) * 1.6
+ if (bars < s.minBars) score -= 6.0 * ln(s.minBars.toDouble() / bars) / ln(2.0)
// Strong tempo changes are heard: shorter mixes then.
score -= abs(m.speed - 1) / 0.08 * bars / 16.0
// A's loud bars after the mix (cut short) and a long silence of A inside the mix.
@@ -131,6 +154,9 @@ object MixPlanner {
return best
}
+ /** Blend lengths tried, bars (longest first). */
+ private val BARS = intArrayOf(32, 24, 16, 12, 8, 6, 4, 2)
+
private fun cut(a: TrackAnalysis, b: TrackAnalysis, ga: Grid, gb: Grid?, m: TempoMatch?, s: Settings): MixPlan? {
val exits = exitCues(a, ga)
if (exits.isEmpty()) return null
@@ -143,8 +169,8 @@ object MixPlanner {
if (synced) restore(speed, gb!!.period) else 0.0, "cut on ${e.why}" + if (synced) "" else ", tempos apart")
}
- private fun fade(a: TrackAnalysis, b: TrackAnalysis, s: Settings, why: String): MixPlan {
- val len = min(s.fadeSec, (a.contentEnd - a.contentStart) / 4)
+ private fun fade(a: TrackAnalysis, b: TrackAnalysis, why: String, seconds: Double): MixPlan {
+ val len = min(seconds, (a.contentEnd - a.contentStart) / 4)
// On a bar of A (its bars come from the model's beats even without a steady grid), with B's
// first downbeat on it when B has one.
val target = max(a.contentStart, musicEnd(a) - len * 0.6)
diff --git a/base/automix/src/test/kotlin/app/myspoti/automix/AutoMixTest.kt b/base/automix/src/test/kotlin/app/myspoti/automix/AutoMixTest.kt
index e1d0512e..b4c3a217 100644
--- a/base/automix/src/test/kotlin/app/myspoti/automix/AutoMixTest.kt
+++ b/base/automix/src/test/kotlin/app/myspoti/automix/AutoMixTest.kt
@@ -11,7 +11,7 @@ import kotlin.math.sin
class AutoMixTest {
/** A drum loop at [bpm]: kick on 1 and 3 (low), snare on 2 and 4 (noise), hat on eighths, a bass note per bar. */
- private fun loop(bpm: Double, seconds: Double, offset: Double = 0.5, seed: Long = 1): FloatArray {
+ private fun loop(bpm: Double, seconds: Double, offset: Double = 0.5, seed: Long = 1, transpose: Int = 0): FloatArray {
val sr = Features.RATE
val x = FloatArray((seconds * sr).toInt())
val rnd = java.util.Random(seed)
@@ -33,7 +33,7 @@ class AutoMixTest {
k++
}
// A bass note changing every bar (pitch classes C, F, G, C).
- val notes = doubleArrayOf(65.4, 87.3, 98.0, 65.4)
+ val notes = doubleArrayOf(65.4, 87.3, 98.0, 65.4).map { it * Math.pow(2.0, transpose / 12.0) }
for (i in x.indices) {
val t = i.toDouble() / sr - offset
if (t < 0) continue
@@ -124,4 +124,59 @@ class AutoMixTest {
// Nothing known: a short fade.
assertEquals(MixPlan.Style.FADE, MixPlanner.planSkip(null, null, 40.0, 0.5).style)
}
+
+ @Test fun cutAskedCutsOnTheBeat() {
+ val a = Analyzer.analyze(loop(124.0, 90.0, seed = 1), null)
+ val b = Analyzer.analyze(loop(122.0, 90.0, offset = 0.3, seed = 2), null)
+ val p = MixPlanner.plan(a, b, MixPlanner.Settings(style = MixPlan.Style.CUT))
+ assertEquals(MixPlan.Style.CUT, p.style)
+ // On one of A's downbeats, over two beats at most.
+ val g = a.tail!!
+ assertEquals(0.0, Math.floorMod(Math.round(g.index(p.exitA) - g.index(a.tailDown)).toInt(), 4).toDouble(), 0.0)
+ assertEquals(2 * g.period, p.length, 1e-9)
+ // A skip asked as a cut is a cut too.
+ assertEquals(MixPlan.Style.CUT, MixPlanner.planSkip(a, b, 40.0, 0.5, MixPlanner.Settings(style = MixPlan.Style.CUT)).style)
+ }
+
+ @Test fun fadeAskedIsAPlainFadeOfItsLength() {
+ val a = Analyzer.analyze(loop(124.0, 90.0, seed = 1), null)
+ val b = Analyzer.analyze(loop(122.0, 90.0, offset = 0.3, seed = 2), null)
+ val p = MixPlanner.plan(a, b, MixPlanner.Settings(style = MixPlan.Style.FADE, smoothSec = 4.0))
+ assertEquals(MixPlan.Style.FADE, p.style)
+ assertEquals(4.0, p.length, 1e-9)
+ assertEquals(1.0, p.speedB, 0.0)
+ assertEquals(MixPlan.Style.FADE, MixPlanner.planSkip(a, b, 40.0, 0.5, MixPlanner.Settings(style = MixPlan.Style.FADE)).style)
+ }
+
+ @Test fun mixLengthStaysInItsBars() {
+ val a = Analyzer.analyze(loop(124.0, 180.0, seed = 1), null)
+ val b = Analyzer.analyze(loop(122.0, 180.0, offset = 0.3, seed = 2), null)
+ val short = MixPlanner.plan(a, b, MixPlanner.Settings(lengthBias = -1, minBars = 4, maxBars = 8))
+ assertEquals(MixPlan.Style.BLEND, short.style)
+ assertTrue("short: ${short.beats / 4} bars", short.beats in 16..32)
+ val long = MixPlanner.plan(a, b, MixPlanner.Settings(maxSec = 64.0, lengthBias = 1, minBars = 12, maxBars = 32))
+ assertEquals(MixPlan.Style.BLEND, long.style)
+ assertTrue("long: ${long.beats / 4} bars", long.beats >= 48)
+ // Two songs too short for the bars asked for: a shorter blend rather than none.
+ val a2 = Analyzer.analyze(loop(124.0, 60.0, seed = 1), null)
+ val b2 = Analyzer.analyze(loop(122.0, 60.0, offset = 0.3, seed = 2), null)
+ assertEquals(MixPlan.Style.BLEND, MixPlanner.plan(a2, b2, MixPlanner.Settings(maxSec = 64.0, lengthBias = 1, minBars = 12, maxBars = 32)).style)
+ }
+
+ /** [a] with a clear [key] (the loops' own keys are too weak to count). */
+ private fun withKey(a: TrackAnalysis, key: Int) = TrackAnalysis(a.duration, a.contentStart, a.contentEnd, a.loudnessDb, key, 1.0, a.bpm,
+ a.steady, a.head, a.tail, a.beats, a.barStarts, a.barDb, a.barLowDb, a.barHighDb, a.barCentre, a.barNovelty, a.phraseOffset,
+ a.stereo, a.headDown, a.tailDown, a.note)
+
+ @Test fun harmonicMixingShortensClashingKeys() {
+ val a = withKey(Analyzer.analyze(loop(124.0, 120.0, seed = 1), null), 0) // C major, 8B
+ val loopB = Analyzer.analyze(loop(122.0, 120.0, offset = 0.3, seed = 2), null)
+ val clash = withKey(loopB, 6) // F# major, 2B
+ assertEquals(2.0, MixPlanner.keyDistance(a, clash), 0.0)
+ val off = MixPlanner.plan(a, clash, MixPlanner.Settings(keyWeight = 0.0))
+ val on = MixPlanner.plan(a, clash, MixPlanner.Settings(keyWeight = 2.0))
+ assertTrue("on ${on.beats} off ${off.beats}", on.beats < off.beats)
+ // Keys ignored: a clash plans as a match does.
+ assertEquals(off.beats, MixPlanner.plan(a, withKey(loopB, 7), MixPlanner.Settings(keyWeight = 0.0)).beats)
+ }
}
diff --git a/docs/automix/README.md b/docs/automix/README.md
index f078b6ea..d1862f96 100644
--- a/docs/automix/README.md
+++ b/docs/automix/README.md
@@ -28,7 +28,8 @@ Two Media3 facts shaped the new design (read in Media3 1.8.0, the version the ap
**Analysis** (`base/automix`, pure Kotlin, the same code on the phone and on the desktop bench).
Each song is decoded once through the player's own data source (downloads decrypted, extension
-streams resolved, DASH answers read as one file; streams only on unmetered networks), to mid and side at 22.05 kHz.
+streams resolved, DASH answers read as one file; streams only on unmetered networks unless "Analyse on
+mobile data" is on, never under the data saver), to mid and side at 22.05 kHz.
- Onsets: spectral flux on 40 log bands, plus the bands under 150 Hz (kicks, 808s).
- Beat This! small0 (MIT, int8 ONNX, ONNX Runtime) on the whole song gives the metrical level
(pure onset autocorrelation hesitates between the beat and ¾ or 4⁄3 of it on trap hi-hats) and
@@ -50,11 +51,30 @@ streams resolved, DASH answers read as one file; streams only on unmetered netwo
analysed too, so a skip finds both of its songs ready. Beat This final0 (10× the parameters) would
take 40–80 s a song for better metrical decisions on a few hard songs: not used.
+**Settings** (Transitions → AutoMix, both looks; `MixPlanner.Settings` from `AutoMix.settings()`):
+- *Transition style*: Beat blend (the styles below, chosen per pair), Cut on the beat (always CUT when
+ A has a grid, else FADE; a skip cuts too), Smooth fade (always FADE, tempos untouched).
+- *Mix length*, three levels mapped to bars: Short 4–8, Balanced 2–16, Long 12–32 (`maxSec` 64 s). The
+ upper end is a limit; the lower one a preference: a blend under it costs 6 points per halving, so a
+ pair that fits nothing longer still gets a shorter blend rather than a cut. A smooth fade lasts 4, 8 or 14 s.
+- *Harmonic mixing* (on by default): the key distance weighs ×2 in the blend's score (×1 before this
+ setting existed); off, ×0 (keys ignored).
+- *Mix podcasts* (off by default): a podcast episode or an audiobook at either end (`LocalTrack.speech`:
+ downloaded episodes, MediaStore's IS_PODCAST/IS_AUDIOBOOK) is neither analysed nor mixed, and Next cuts.
+- *Analyse on mobile data* (off by default): each extension stream is read a second time, about the
+ song's size again.
+- Saving energy (`AutoMix.frugal`: the app's energy saver, its data saver applying, Android's battery
+ saver, or under 20 % unplugged): the song playing and the next one only, two threads.
+- Spotify songs, with AutoMix on, change with a 3-s fade (`TransitionPref.SPOTIFY_FADE_SECONDS`),
+ not with the crossfade length kept for later.
+- `AutoMix.whyNot()` says why the next song is not mixed (Off, Cast, SpotifyStream, Podcast, Album,
+ MobileData, Frugal, NotAnalyzed), for the screens. Casting: no deck (any is dropped when the cast starts).
+
**Planning** (`MixPlanner`): exit cues on A's downbeats in its last minute and a half (phrase starts,
a level drop after them, late; never past where its music really ends, before a long fade-out),
entry cues on B's first downbeat or a phrase start in its intro (a skip costs, less over a quiet
-intro, or the point that puts B's strong beat right at the end of the mix); 16, 12, 8, 6, 4 or 2
-bars, the whole mix inside the span where both grids were checked, scored first for B's strong beat
+intro, or the point that puts B's strong beat right at the end of the mix); 32, 24, 16, 12, 8, 6, 4 or 2
+bars (within the length setting), the whole mix inside the span where both grids were checked, scored first for B's strong beat
(the drop, the first verse: where its level and bass jump) landing when A is gone, then for: A's loud bars
left out, two voices at once, two loud songs at once, key distance on the Camelot wheel, size of
the tempo change. Styles: