added Html decoding for UTF-8 chars decoded with ISO8859-1 by Airtime
parent
a59d57a685
commit
0b37a838e9
|
|
@ -1,5 +1,6 @@
|
||||||
package fr.forum_thalie.tsumugi.playerstore
|
package fr.forum_thalie.tsumugi.playerstore
|
||||||
|
|
||||||
|
import androidx.core.text.HtmlCompat
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import fr.forum_thalie.tsumugi.noConnectionValue
|
import fr.forum_thalie.tsumugi.noConnectionValue
|
||||||
|
|
||||||
|
|
@ -24,8 +25,9 @@ class Song(artistTitle: String = "", _id : Int = 0) {
|
||||||
return "id=$id | ${artist.value} - ${title.value} | type=${type.value} | times ${startTime.value} - ${stopTime.value}\n"
|
return "id=$id | ${artist.value} - ${title.value} | type=${type.value} | times ${startTime.value} - ${stopTime.value}\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTitleArtist(data: String)
|
fun setTitleArtist(dataHtml: String)
|
||||||
{
|
{
|
||||||
|
val data = HtmlCompat.fromHtml(dataHtml, HtmlCompat.FROM_HTML_MODE_LEGACY).toString()
|
||||||
val hyphenPos = data.indexOf(" - ")
|
val hyphenPos = data.indexOf(" - ")
|
||||||
try {
|
try {
|
||||||
if (hyphenPos < 0)
|
if (hyphenPos < 0)
|
||||||
|
|
@ -50,8 +52,7 @@ class Song(artistTitle: String = "", _id : Int = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun copy(song: Song) {
|
fun copy(song: Song) {
|
||||||
this.title.value = song.title.value
|
this.setTitleArtist(song.artist.value + " - " + song.title.value)
|
||||||
this.artist.value = song.artist.value
|
|
||||||
this.startTime.value = song.startTime.value
|
this.startTime.value = song.startTime.value
|
||||||
this.stopTime.value = song.stopTime.value
|
this.stopTime.value = song.stopTime.value
|
||||||
this.type.value = song.type.value
|
this.type.value = song.type.value
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue