Recently Written · git

subread-dictionary

Pop-up dictionary for Android that reads Yomitan dictionaries, with local audio

git clone https://github.com/equwal/subread-dictionary

Log | Files | Refs


commit 13eb4ddbe45ec03d34d335cd8e60f1500065d3ff
equwal <truex@equwal.com>
2026-09-21 20:59:05 -0700

Show the Forvo speaker once in the audio source list

The Forvo rows of android.db have the speaker in both the speaker and the
display column.

 app/src/main/kotlin/space/subread/dictionary/Audio.kt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/src/main/kotlin/space/subread/dictionary/Audio.kt b/app/src/main/kotlin/space/subread/dictionary/Audio.kt
index 689bc51..6a25695 100644
--- a/app/src/main/kotlin/space/subread/dictionary/Audio.kt
+++ b/app/src/main/kotlin/space/subread/dictionary/Audio.kt
@@ -34,7 +34,8 @@ class LocalAudio(private val file: File, private val sourceOrder: List<String>)
         }
         val ordered = rows.sortedBy { sourceOrder.indexOf(it.source).let { i -> if (i < 0) sourceOrder.size else i } }
         return ordered.map { row ->
-            val name = listOfNotNull(label(row.source), row.speaker, row.display).joinToString(" ")
+            // Forvo puts the speaker in both columns: show it once.
+            val name = listOfNotNull(label(row.source), row.speaker, row.display).distinct().joinToString(" ")
             AudioSource(name) {
                 db.rawQuery("SELECT data FROM android WHERE file = ? AND source = ?", arrayOf(row.file, row.source)).use { c ->
                     if (c.moveToFirst()) c.getBlob(0) else null