music: indicate interpreted song artists
Kind of stupid, but since I don't really have a good streaming representation of interpreting progress yet this is what worksbest.
This commit is contained in:
parent
1962fbe70a
commit
dba11a61b4
1 changed files with 7 additions and 2 deletions
|
@ -25,6 +25,7 @@ import kotlinx.coroutines.flow.asFlow
|
||||||
import kotlinx.coroutines.flow.buffer
|
import kotlinx.coroutines.flow.buffer
|
||||||
import kotlinx.coroutines.flow.flowOn
|
import kotlinx.coroutines.flow.flowOn
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
|
import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.flow.toList
|
import kotlinx.coroutines.flow.toList
|
||||||
import org.oxycblt.auxio.music.Music
|
import org.oxycblt.auxio.music.Music
|
||||||
import org.oxycblt.auxio.music.stack.explore.AudioFile
|
import org.oxycblt.auxio.music.stack.explore.AudioFile
|
||||||
|
@ -68,7 +69,11 @@ class InterpreterImpl @Inject constructor(private val preparer: Preparer) : Inte
|
||||||
|
|
||||||
val artistLinker = ArtistLinker()
|
val artistLinker = ArtistLinker()
|
||||||
val artistLinkedSongs =
|
val artistLinkedSongs =
|
||||||
artistLinker.register(genreLinkedSongs).flowOn(Dispatchers.Main).toList()
|
artistLinker
|
||||||
|
.register(genreLinkedSongs)
|
||||||
|
.onEach { onInterpret() }
|
||||||
|
.flowOn(Dispatchers.Main)
|
||||||
|
.toList()
|
||||||
// This is intentional. Song and album instances are dependent on artist
|
// This is intentional. Song and album instances are dependent on artist
|
||||||
// data, so we need to ensure that all of the linked artist data is resolved
|
// data, so we need to ensure that all of the linked artist data is resolved
|
||||||
// before we go any further.
|
// before we go any further.
|
||||||
|
@ -90,7 +95,7 @@ class InterpreterImpl @Inject constructor(private val preparer: Preparer) : Inte
|
||||||
val uid = it.preSong.computeUid()
|
val uid = it.preSong.computeUid()
|
||||||
val other = uidMap[uid]
|
val other = uidMap[uid]
|
||||||
if (other == null) {
|
if (other == null) {
|
||||||
SongImpl(it).also { onInterpret() }
|
SongImpl(it)
|
||||||
} else {
|
} else {
|
||||||
L.d("Song @ $uid already exists at ${other.path}, ignoring")
|
L.d("Song @ $uid already exists at ${other.path}, ignoring")
|
||||||
null
|
null
|
||||||
|
|
Loading…
Reference in a new issue