Browse Source

fixed initialization error (no postValue!), last played works again now

yattoz 4 years ago
parent
commit
931b46c496
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt

+ 4 - 2
app/src/main/java/fr/forum_thalie/tsumugi/playerstore/Song.kt View File

@@ -1,6 +1,7 @@
1 1
 package fr.forum_thalie.tsumugi.playerstore
2 2
 
3 3
 import androidx.lifecycle.MutableLiveData
4
+import fr.forum_thalie.tsumugi.noConnectionValue
4 5
 
5 6
 class Song(artistTitle: String = "", _id : Int = 0) {
6 7
 
@@ -35,9 +36,10 @@ class Song(artistTitle: String = "", _id : Int = 0) {
35 36
                 title.value = data.substring(hyphenPos + 3)
36 37
         } catch (e: Exception) {
37 38
             if (artist.value != "")
38
-                artist.postValue("")
39
+                artist.value = ""
39 40
             if (title.value != data)
40
-                title.postValue(data)
41
+                title.value = data
42
+            // else : do nothing
41 43
         }
42 44
     }
43 45