Compare commits

...
Author SHA1 Message Date
FojadrachiandClaude Opus 5.5 e0dd61fbb4 feat: Jam-Host abgeben, Einladen-Code mittig (1.7.0)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 11:12:43 +01:00
FojadrachiandClaude Opus 5.5 e3c534c569 fix(diag): Video-IDs ohne Ziffern und Titel/Namen in JSON-Zeilen entfernen
Gleiche Regel wie PC und Server (playtube-jam/src/diag.js).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-14 00:02:47 +01:00
FojadrachiandClaude Opus 5.5 94485dc326 release: Playtube fuer Android 1.6.1 ("Jetzt senden" immer, Jam genauer synchron)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 18:32:09 +01:00
FojadrachiandClaude Opus 5.5 75445d06c5 feat: Jam genauer synchron (Tempo-Feinabgleich, Messzeitpunkt, Spul-Vorhalt)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 18:20:34 +01:00
FojadrachiandClaude Opus 5.5 448b4b8edf fix: "Jetzt senden" schickt immer einen Bericht (auch ohne neue Eintraege)
Nach frischer Installation ist das Diagnose-Log leer; der Knopf meldete dann nur
"Keine neuen Eintraege". Jetzt geht ein Bericht mit Vermerk "manuell gesendet" raus.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 23:01:57 +01:00
13 changed files with 153 additions and 34 deletions
+2 -2
View File
@@ -19,8 +19,8 @@ android {
applicationId = "de.fojadrachi.playtube" applicationId = "de.fojadrachi.playtube"
minSdk = 26 minSdk = 26
targetSdk = 36 targetSdk = 36
versionCode = 10 versionCode = 12
versionName = "1.6.0" versionName = "1.7.0"
// Update-Quelle: eigener Gitea-Server (kein GitHub/Google Play). // Update-Quelle: eigener Gitea-Server (kein GitHub/Google Play).
buildConfigField("String", "UPDATE_SERVER", "\"https://git.fojadrachi.de\"") buildConfigField("String", "UPDATE_SERVER", "\"https://git.fojadrachi.de\"")
@@ -20,14 +20,20 @@ object DiagReport {
private val EMAIL = Regex("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}") private val EMAIL = Regex("[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}")
private val URL_QUERY = Regex("(?i)(https?://[^\\s?#\"']+)[?#][^\\s\"']*") private val URL_QUERY = Regex("(?i)(https?://[^\\s?#\"']+)[?#][^\\s\"']*")
private val WORD = Regex("[A-Za-z0-9_-]+") private val WORD = Regex("[A-Za-z0-9_-]+")
private val JSON_PRIVATE = Regex("(?i)(\"(?:title|artist|author|album|name|query|q|search)\"\\s*:\\s*)\"(?:[^\"\\\\]|\\\\.)*\"")
private val CAMEL = Regex("^([A-Z][a-z]+)+$")
private val CONTROL = Regex("[\\u0000-\\u0008\\u000b-\\u001f\\u007f\\u202a-\\u202e\\u2066-\\u2069]") private val CONTROL = Regex("[\\u0000-\\u0008\\u000b-\\u001f\\u007f\\u202a-\\u202e\\u2066-\\u2069]")
/** YouTube-Video-ID: 11 Zeichen, Gross- und Kleinbuchstaben gemischt plus Ziffer, `_` oder `-`. */ /**
fun looksLikeVideoId(word: String): Boolean = * YouTube-Video-ID: 11 Zeichen aus `[A-Za-z0-9_-]`, entweder Buchstaben plus Ziffer/`_`/`-` oder
word.length == 11 && * mindestens zwei Grossbuchstaben ohne normale Schreibweise (nicht "Verbindunge", "ServerError").
word.all { it.isLetterOrDigit() && it.code < 128 || it == '_' || it == '-' } && */
word.any { it in 'A'..'Z' } && word.any { it in 'a'..'z' } && fun looksLikeVideoId(word: String): Boolean {
word.any { it.isDigit() || it == '_' || it == '-' } if (word.length != 11 || !word.all { it in 'A'..'Z' || it in 'a'..'z' || it in '0'..'9' || it == '_' || it == '-' }) return false
val letters = word.any { it.isLetter() }
if (word.any { it.isDigit() || it == '_' || it == '-' }) return letters
return word.count { it in 'A'..'Z' } >= 2 && word.any { it in 'a'..'z' } && !CAMEL.matches(word)
}
private fun looksLikeSecret(word: String): Boolean = private fun looksLikeSecret(word: String): Boolean =
word.length >= 20 && word.any { it.isDigit() } && word.any { it.isLetter() } word.length >= 20 && word.any { it.isDigit() } && word.any { it.isLetter() }
@@ -39,6 +45,7 @@ object DiagReport {
text = SECRET.replace(text) { "${it.groupValues[1]}${it.groupValues[2]}[entfernt]" } text = SECRET.replace(text) { "${it.groupValues[1]}${it.groupValues[2]}[entfernt]" }
text = EMAIL.replace(text, "[e-mail]") text = EMAIL.replace(text, "[e-mail]")
text = URL_QUERY.replace(text) { "${it.groupValues[1]}?[…]" } text = URL_QUERY.replace(text) { "${it.groupValues[1]}?[…]" }
text = JSON_PRIVATE.replace(text) { "${it.groupValues[1]}\"[entfernt]\"" }
text = WORD.replace(text) { text = WORD.replace(text) {
when { when {
looksLikeVideoId(it.value) -> "[video]" looksLikeVideoId(it.value) -> "[video]"
@@ -72,6 +79,13 @@ object DiagReport {
return listOf("absturz", "exception", "error", "fehler", "fehlgeschlagen", "failed").any { it in lower } return listOf("absturz", "exception", "error", "fehler", "fehlgeschlagen", "failed").any { it in lower }
} }
/** Vermerk zum Bericht: manuell gesendet (ggf. ohne neue Einträge) oder leer. */
fun note(manual: Boolean, noNewLines: Boolean): String = when {
manual && noNewLines -> "manuell gesendet (keine neuen Einträge)"
manual -> "manuell gesendet"
else -> ""
}
fun build(installId: String, version: String, androidVersion: String, device: String, lines: List<String>, note: String = ""): JSONObject = fun build(installId: String, version: String, androidVersion: String, device: String, lines: List<String>, note: String = ""): JSONObject =
JSONObject() JSONObject()
.put("app", "android") .put("app", "android")
@@ -85,17 +85,21 @@ object Diagnostics {
if (!isEnabled(context)) return if (!isEnabled(context)) return
val now = System.currentTimeMillis() val now = System.currentTimeMillis()
if (now - prefs(context).getLong(KEY_LAST_TRY, 0) < INTERVAL_MS) return if (now - prefs(context).getLong(KEY_LAST_TRY, 0) < INTERVAL_MS) return
send(context) { } send(context, manual = false) { }
} }
/** Senden; [done] bekommt (null = nichts Neues, true/false = Erfolg) auf dem Hauptthread. */ /**
fun send(context: Context, done: (Boolean?) -> Unit) { * Senden; [done] bekommt (null = nichts Neues, true/false = Erfolg) auf dem Hauptthread.
* [manual] ("Jetzt senden"): geht auch ohne neue Logzeilen raus, dann mit dem Vermerk
* "manuell gesendet" (Version, Gerät und Kennung reichen zum Prüfen).
*/
fun send(context: Context, manual: Boolean, done: (Boolean?) -> Unit) {
val ctx = context.applicationContext val ctx = context.applicationContext
Thread { Thread {
val prefs = prefs(ctx) val prefs = prefs(ctx)
val text = runCatching { logFile(ctx).readText() }.getOrDefault("") val text = runCatching { logFile(ctx).readText() }.getOrDefault("")
val collected = DiagReport.collect(text, prefs.getLong(KEY_LAST_SENT, 0)) val collected = DiagReport.collect(text, prefs.getLong(KEY_LAST_SENT, 0))
if (collected.lines.isEmpty()) { if (collected.lines.isEmpty() && !manual) {
main.post { done(null) } main.post { done(null) }
return@Thread return@Thread
} }
@@ -106,6 +110,7 @@ object Diagnostics {
Build.VERSION.RELEASE ?: "?", Build.VERSION.RELEASE ?: "?",
"${Build.MANUFACTURER} ${Build.MODEL}".take(80), "${Build.MANUFACTURER} ${Build.MODEL}".take(80),
collected.lines, collected.lines,
DiagReport.note(manual, collected.lines.isEmpty()),
) )
val ok = post("${BuildConfig.JAM_SERVER}/api/diag", body.toString()) val ok = post("${BuildConfig.JAM_SERVER}/api/diag", body.toString())
if (ok) prefs.edit().putLong(KEY_LAST_SENT, collected.latest).apply() if (ok) prefs.edit().putLong(KEY_LAST_SENT, collected.latest).apply()
@@ -309,7 +309,18 @@ class JamActivity : AppCompatActivity() {
Unit Unit
} }
} else null } else null
members.addView(row(name, info, image = null, initial = m.name.take(1).uppercase(), action1 = null, action2 = kick).apply { // Host-Rolle abgeben (nur an jemanden, der gerade verbunden ist).
val makeHost = if (state.isHost && m.id != state.you && m.online) {
R.drawable.ic_crown to {
AlertDialog.Builder(this)
.setMessage(getString(R.string.jam_make_host_confirm, m.name))
.setPositiveButton(R.string.jam_make_host) { _, _ -> JamHub.send("transfer", "memberId" to m.id) }
.setNegativeButton(R.string.pc_cancel, null)
.show()
Unit
}
} else null
members.addView(row(name, info, image = null, initial = m.name.take(1).uppercase(), action1 = makeHost, action2 = kick).apply {
alpha = if (m.online) 1f else 0.5f alpha = if (m.online) 1f else 0.5f
}) })
} }
@@ -17,6 +17,7 @@ import okhttp3.WebSocketListener
import org.json.JSONObject import org.json.JSONObject
import java.io.IOException import java.io.IOException
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import kotlin.math.abs
/** /**
* Playtube Jam: Verbindung zum Jam-Server und gemeinsamer Zustand fuer [JamActivity] (Anzeige) * Playtube Jam: Verbindung zum Jam-Server und gemeinsamer Zustand fuer [JamActivity] (Anzeige)
@@ -275,6 +276,7 @@ object JamHub {
"not_allowed" -> str(R.string.jam_error_not_allowed) "not_allowed" -> str(R.string.jam_error_not_allowed)
"queue_full" -> str(R.string.jam_error_queue_full) "queue_full" -> str(R.string.jam_error_queue_full)
"bad_video" -> str(R.string.jam_error_bad_video) "bad_video" -> str(R.string.jam_error_bad_video)
"offline" -> str(R.string.jam_error_offline)
"playlist_not_found" -> str(R.string.jam_error_playlist) "playlist_not_found" -> str(R.string.jam_error_playlist)
"rate_limited" -> str(R.string.jam_error_rate_limited) "rate_limited" -> str(R.string.jam_error_rate_limited)
else -> str(R.string.jam_error_other, error) else -> str(R.string.jam_error_other, error)
@@ -382,11 +384,15 @@ object JamHub {
fun syncPlayer(probe: JSONObject): Actions { fun syncPlayer(probe: JSONObject): Actions {
val s = state ?: return Actions(null, emptyList()) val s = state ?: return Actions(null, emptyList())
val now = SystemClock.elapsedRealtime() val now = SystemClock.elapsedRealtime()
val want = JamSync.target(s, clock.serverNow(System.currentTimeMillis().toDouble())) // Soll-Position zum Zeitpunkt der Messung in der Seite (nicht erst nach der Antwort).
val wall = System.currentTimeMillis().toDouble()
val sampled = probe.optDouble("now", wall).takeIf { it.isFinite() && abs(it - wall) < 5000 } ?: wall
val want = JamSync.target(s, clock.serverNow(sampled))
val local = JamSync.Local( val local = JamSync.Local(
videoId = probe.optString("id").takeIf { it.isNotEmpty() && it != "null" && !probe.isNull("id") }, videoId = probe.optString("id").takeIf { it.isNotEmpty() && it != "null" && !probe.isNull("id") },
pos = probe.optDouble("t", 0.0), pos = probe.optDouble("t", 0.0),
paused = probe.optBoolean("paused", true), paused = probe.optBoolean("paused", true),
rate = probe.optDouble("rate", 1.0).takeIf { it.isFinite() && it > 0 } ?: 1.0,
) )
val duration = probe.optDouble("d", 0.0) val duration = probe.optDouble("d", 0.0)
val scripts = ArrayList<String>() val scripts = ArrayList<String>()
@@ -477,6 +483,7 @@ object JamHub {
expectUntil = now + 3000 expectUntil = now + 3000
scripts.add(pause) scripts.add(pause)
} }
is JamSync.Step.Rate -> scripts.add(JamSync.rateScript(step.rate))
} }
} }
return Actions(load, scripts) return Actions(load, scripts)
@@ -13,7 +13,25 @@ import kotlin.math.max
* paused ? position : position + (T - ref) / 1000. Negativ heisst "startet gleich". * paused ? position : position + (T - ref) / 1000. Negativ heisst "startet gleich".
*/ */
object JamSync { object JamSync {
const val TOLERANCE_S = 1.5 const val TOLERANCE_S = 1.0
/** Beim Spulen etwas vorhalten: bis das Video an der neuen Stelle spielt, vergeht Zeit. */
const val SEEK_LEAD_S = 0.2
private const val NUDGE_START_S = 0.08
private const val NUDGE_STOP_S = 0.03
private const val NUDGE_GAIN = 0.25
private const val NUDGE_MAX = 0.08
/**
* Wiedergabetempo, das eine kleine Abweichung [drift] (eigene minus Jam-Position, s) ausgleicht -
* unhoerbar, die Tonhoehe bleibt. Einmal angefangen ([current] != 1) bis fast 0 ausgleichen.
*/
fun nudgeRate(drift: Double, current: Double): Double {
val threshold = if (abs(current - 1.0) > 0.001) NUDGE_STOP_S else NUDGE_START_S
if (!drift.isFinite() || abs(drift) < threshold) return 1.0
val rate = (1.0 - NUDGE_GAIN * drift).coerceIn(1.0 - NUDGE_MAX, 1.0 + NUDGE_MAX)
return Math.round(rate * 1000.0) / 1000.0
}
private const val CODE_ALPHABET = "ABCDEFGHJKMNPQRSTUVWXYZ23456789" private const val CODE_ALPHABET = "ABCDEFGHJKMNPQRSTUVWXYZ23456789"
private val VIDEO_ID = Regex("^[A-Za-z0-9_-]{11}$") private val VIDEO_ID = Regex("^[A-Za-z0-9_-]{11}$")
@@ -207,13 +225,14 @@ object JamSync {
return Target(item.videoId, item.id, positionAt(state.playback, serverNow), state.playback.paused, item.dur) return Target(item.videoId, item.id, positionAt(state.playback, serverNow), state.playback.paused, item.dur)
} }
data class Local(val videoId: String?, val pos: Double, val paused: Boolean) data class Local(val videoId: String?, val pos: Double, val paused: Boolean, val rate: Double = 1.0)
sealed class Step { sealed class Step {
data class Load(val videoId: String, val pos: Double) : Step() data class Load(val videoId: String, val pos: Double) : Step()
data class Seek(val pos: Double) : Step() data class Seek(val pos: Double) : Step()
data object Play : Step() data object Play : Step()
data object Pause : Step() data object Pause : Step()
data class Rate(val rate: Double) : Step()
} }
/** Was der eigene Player tun soll, damit er zum Jam passt. */ /** Was der eigene Player tun soll, damit er zum Jam passt. */
@@ -233,9 +252,14 @@ object JamSync {
if (local.pos > 0.5) steps.add(Step.Seek(0.0)) if (local.pos > 0.5) steps.add(Step.Seek(0.0))
return steps return steps
} }
if (abs(local.pos - want.pos) > tolerance && !(nearEnd && local.pos > want.pos)) steps.add(Step.Seek(want.pos)) val drift = local.pos - want.pos
val seek = abs(drift) > tolerance && !(nearEnd && local.pos > want.pos)
if (seek) steps.add(Step.Seek(if (want.paused) want.pos else want.pos + SEEK_LEAD_S))
if (want.paused && !local.paused) steps.add(Step.Pause) if (want.paused && !local.paused) steps.add(Step.Pause)
if (!want.paused && local.paused) steps.add(Step.Play) if (!want.paused && local.paused) steps.add(Step.Play)
// Feinabgleich ueber das Tempo, solange beide normal laufen.
val desired = if (!seek && !want.paused && !local.paused && !nearEnd) nudgeRate(drift, local.rate) else 1.0
if (abs(desired - local.rate) > 0.004) steps.add(Step.Rate(desired))
return steps return steps
} }
@@ -271,6 +295,8 @@ object JamSync {
d: api('getDuration') && player.getDuration() > 0 ? player.getDuration() : ((video && isFinite(video.duration)) ? video.duration : 0), d: api('getDuration') && player.getDuration() > 0 ? player.getDuration() : ((video && isFinite(video.duration)) ? video.duration : 0),
paused: paused, paused: paused,
ended: state === 0 || (video ? video.ended : false), ended: state === 0 || (video ? video.ended : false),
rate: video && video.playbackRate > 0 ? video.playbackRate : 1,
now: Date.now(),
ad: ad, ad: ad,
error: error, error: error,
title: meta && meta.title ? meta.title : null, title: meta && meta.title ? meta.title : null,
@@ -288,6 +314,14 @@ object JamSync {
"var v=p&&p.querySelector('video')||document.querySelector('video');if(v){v.$prop();}})();" "var v=p&&p.querySelector('video')||document.querySelector('video');if(v){v.$prop();}})();"
} }
/** Wiedergabetempo des Players (Feinabgleich, Tonhoehe bleibt). */
fun rateScript(rate: Double): String {
val r = if (rate.isFinite()) rate.coerceIn(0.5, 2.0) else 1.0
return "(function(){var p=document.getElementById('movie_player');" +
"var v=p&&p.querySelector('video')||document.querySelector('video');" +
"if(v){v.preservesPitch=true;v.playbackRate=$r;}})();"
}
fun seekScript(seconds: Double): String { fun seekScript(seconds: Double): String {
val s = if (seconds.isFinite()) max(0.0, seconds) else 0.0 val s = if (seconds.isFinite()) max(0.0, seconds) else 0.0
return "(function(){var p=document.getElementById('movie_player');var s=$s;" + return "(function(){var p=document.getElementById('movie_player');var s=$s;" +
@@ -276,7 +276,7 @@ class MainActivity : AppCompatActivity() {
.setView(content) .setView(content)
.setPositiveButton(R.string.diag_done, null) .setPositiveButton(R.string.diag_done, null)
.setNeutralButton(R.string.diag_send_now) { _, _ -> .setNeutralButton(R.string.diag_send_now) { _, _ ->
Diagnostics.send(this) { ok -> Diagnostics.send(this, manual = true) { ok ->
val text = when (ok) { val text = when (ok) {
null -> R.string.diag_nothing null -> R.string.diag_nothing
true -> R.string.diag_sent true -> R.string.diag_sent
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Krone: "Zum Host machen" in der Teilnehmerliste des Jams -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFAAAAAA"
android:pathData="M5,16L3,5l5.5,5L12,4l3.5,6L21,5l-2,11H5zM19,19c0,0.6 -0.4,1 -1,1H6c-0.6,0 -1,-0.4 -1,-1v-1h14v1z" />
</vector>
+2
View File
@@ -383,6 +383,7 @@
<TextView <TextView
android:id="@+id/jamInviteCode" android:id="@+id/jamInviteCode"
android:layout_width="match_parent" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:letterSpacing="0.1" android:letterSpacing="0.1"
@@ -393,6 +394,7 @@
<TextView <TextView
android:id="@+id/jamInviteLink" android:id="@+id/jamInviteLink"
android:layout_width="match_parent" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/text_muted" android:textColor="@color/text_muted"
android:textIsSelectable="true" android:textIsSelectable="true"
+3
View File
@@ -96,6 +96,9 @@
<string name="jam_client_web">Browser</string> <string name="jam_client_web">Browser</string>
<string name="jam_kick">Entfernen</string> <string name="jam_kick">Entfernen</string>
<string name="jam_kick_confirm">%1$s aus dem Jam entfernen?</string> <string name="jam_kick_confirm">%1$s aus dem Jam entfernen?</string>
<string name="jam_make_host">Zum Host machen</string>
<string name="jam_make_host_confirm">%1$s zum Host machen? Du gibst damit die Host-Rechte ab.</string>
<string name="jam_error_offline">Diese Person ist gerade nicht verbunden.</string>
<string name="jam_play_now">Jetzt spielen</string> <string name="jam_play_now">Jetzt spielen</string>
<string name="jam_remove">Entfernen</string> <string name="jam_remove">Entfernen</string>
<string name="jam_added">Hinzugefügt: %1$s</string> <string name="jam_added">Hinzugefügt: %1$s</string>
@@ -23,6 +23,16 @@ class DiagReportTest {
assertEquals("a b", DiagReport.sanitize("a\u0000b")) assertEquals("a b", DiagReport.sanitize("a\u0000b"))
} }
@Test
fun removesIdsWithoutDigitsAndJsonTitles() {
assertEquals("jam: lade [video]", DiagReport.sanitize("jam: lade JZYXtUJcTws"))
assertEquals(
"Player: {\"artist\":\"[entfernt]\",\"id\":\"[video]\",\"title\":\"[entfernt]\",\"paused\":true}",
DiagReport.sanitize("Player: {\"artist\":\"Band\",\"id\":\"Rlg9P5i1bkQ\",\"title\":\"Mein Song\",\"paused\":true}"),
)
assertEquals("Verbindunge ServerError PlaytubeApp", DiagReport.sanitize("Verbindunge ServerError PlaytubeApp"))
}
@Test @Test
fun recognizesVideoIds() { fun recognizesVideoIds() {
assertTrue(DiagReport.looksLikeVideoId("dQw4w9WgXcQ")) assertTrue(DiagReport.looksLikeVideoId("dQw4w9WgXcQ"))
@@ -47,6 +57,16 @@ class DiagReportTest {
assertEquals("[701] Zeile 701", lines.first()) assertEquals("[701] Zeile 701", lines.first())
} }
@Test
fun manualReportWithoutLinesHasNote() {
assertEquals("manuell gesendet (keine neuen Einträge)", DiagReport.note(manual = true, noNewLines = true))
assertEquals("manuell gesendet", DiagReport.note(manual = true, noNewLines = false))
assertEquals("", DiagReport.note(manual = false, noNewLines = true))
val report = DiagReport.build("abc123abc123", "1.6.1", "15", "Google Pixel 9", emptyList(), DiagReport.note(true, true))
assertEquals(0, report.getJSONArray("lines").length())
assertTrue(report.getString("note").isNotEmpty()) // sonst lehnt der Server den Bericht als leer ab
}
@Test @Test
fun buildsReport() { fun buildsReport() {
val lines = listOf("[1] Absturz in main: java.lang.IllegalStateException", "[2] ok") val lines = listOf("[1] Absturz in main: java.lang.IllegalStateException", "[2] ok")
@@ -42,6 +42,22 @@ class JamSyncTest {
assertNull(JamSync.videoIdFromSharedText("kein Link hier")) assertNull(JamSync.videoIdFromSharedText("kein Link hier"))
} }
@Test
fun `gleicht kleine Abweichungen ueber das Tempo aus`() {
val want = JamSync.Target("aaaaaaaaaaa", "i", 30.0, false, 200.0)
fun local(pos: Double, rate: Double = 1.0, paused: Boolean = false) = JamSync.Local("aaaaaaaaaaa", pos, paused, rate)
assertEquals(listOf(JamSync.Step.Rate(0.92)), JamSync.decide(want, local(30.4)))
assertEquals(listOf(JamSync.Step.Rate(1.05)), JamSync.decide(want, local(29.8)))
assertEquals(listOf(JamSync.Step.Rate(1.0)), JamSync.decide(want, local(30.01, rate = 1.05)))
assertEquals(emptyList<JamSync.Step>(), JamSync.decide(want, local(30.05)))
assertEquals(
listOf(JamSync.Step.Seek(30.0 + JamSync.SEEK_LEAD_S), JamSync.Step.Rate(1.0)),
JamSync.decide(want, local(34.0, rate = 1.08)),
)
assertEquals(0.988, JamSync.nudgeRate(0.05, 1.02), 1e-9)
assertEquals(1.0, JamSync.nudgeRate(0.05, 1.0), 1e-9)
}
@Test @Test
fun `liest Playlist-Links`() { fun `liest Playlist-Links`() {
assertEquals("PLabc_1", JamSync.parsePlaylistId("https://music.youtube.com/playlist?list=PLabc_1")) assertEquals("PLabc_1", JamSync.parsePlaylistId("https://music.youtube.com/playlist?list=PLabc_1"))
@@ -110,8 +126,8 @@ class JamSyncTest {
@Test @Test
fun `spult erst ab der Toleranz`() { fun `spult erst ab der Toleranz`() {
val id = "aaaaaaaaaaa" val id = "aaaaaaaaaaa"
assertTrue(JamSync.decide(want(30.0), local(id, 31.2, false)).isEmpty()) assertTrue(JamSync.decide(want(30.0), local(id, 30.05, false)).isEmpty())
assertEquals(listOf(Step.Seek(30.0)), JamSync.decide(want(30.0), local(id, 34.0, false))) assertEquals(listOf(Step.Seek(30.0 + JamSync.SEEK_LEAD_S)), JamSync.decide(want(30.0), local(id, 34.0, false)))
} }
@Test @Test
+10 -14
View File
@@ -1,21 +1,17 @@
## Playtube für Android 1.6.0 ## Playtube für Android 1.7.0
- **Diagnosedaten:** Damit Fehler schneller behoben werden, schickt Playtube Abstürze und Verbindungsfehler - **Host abgeben:** Als Host kannst du die Rolle im Jam an jemand anderen übergeben – in der Liste „Dabei“ auf die
(ohne Cookies, Anmeldedaten, Suchanfragen, Songtitel oder Video-IDs) an den Playtube-Server; gespeichert Krone neben dem Namen tippen und bestätigen.
wird 30 Tage. Beim ersten Start erscheint ein Hinweis, abschalten geht jederzeit über das neue - **„Freunde einladen“:** Code und Link stehen jetzt mittig.
**Zahnrad** am rechten Rand. Details: playtube-ppp-eula.pages.dev/playtube/privacy/#diag
Alles Weitere wie in 1.5.0 (Playlists und Alben im Jam, Songs laufen automatisch weiter). Voraussetzung: Alles Weitere wie in 1.6.1. Voraussetzung: Android 8.0 oder neuer.
Android 8.0 oder neuer.
--- ---
## Playtube for Android 1.6.0 ## Playtube for Android 1.7.0
- **Diagnostic data:** to fix bugs faster, Playtube sends crashes and connection errors (no cookies, sign-in data, - **Hand over host:** as host you can pass the role in a jam to someone else – tap the crown next to their name in
searches, song titles or video IDs) to the Playtube server; reports are kept for 30 days. A notice is shown on the "Listening" list and confirm.
first start, and you can turn it off at any time via the new **gear** button on the right edge. - **"Invite friends":** the code and link are now centered.
Details: playtube-ppp-eula.pages.dev/playtube/privacy/#diag
Everything else as in 1.5.0 (playlists and albums in the jam, songs continue automatically). Requires Android Everything else as in 1.6.1. Requires Android 8.0 or newer.
8.0 or newer.