musikr: add cover to evaluation process
This commit is contained in:
parent
8b4672ea50
commit
cf69b27134
3 changed files with 13 additions and 3 deletions
|
@ -53,7 +53,7 @@ constructor(
|
|||
val preSongs =
|
||||
extractedMusic
|
||||
.filterIsInstance<ExtractedMusic.Song>()
|
||||
.map { tagInterpreter.interpret(it.file, it.tags, interpretation) }
|
||||
.map { tagInterpreter.interpret(it.file, it.tags, it.cover, interpretation) }
|
||||
.flowOn(Dispatchers.Main)
|
||||
.buffer(Channel.UNLIMITED)
|
||||
val graphBuilder = musicGraphFactory.builder()
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.oxycblt.auxio.music.MusicType
|
|||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.update
|
||||
import org.oxycblt.musikr.Music
|
||||
import org.oxycblt.musikr.cover.Cover
|
||||
import org.oxycblt.musikr.fs.MimeType
|
||||
import org.oxycblt.musikr.fs.Path
|
||||
import org.oxycblt.musikr.playlist.PlaylistHandle
|
||||
|
@ -47,6 +48,7 @@ data class PreSong(
|
|||
val replayGainAdjustment: ReplayGainAdjustment,
|
||||
val lastModified: Long,
|
||||
val dateAdded: Long,
|
||||
val cover: Cover?,
|
||||
val preAlbum: PreAlbum,
|
||||
val preArtists: List<PreArtist>,
|
||||
val preGenres: List<PreGenre>
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.oxycblt.auxio.R
|
|||
import org.oxycblt.auxio.playback.replaygain.ReplayGainAdjustment
|
||||
import org.oxycblt.auxio.util.toUuidOrNull
|
||||
import org.oxycblt.musikr.Interpretation
|
||||
import org.oxycblt.musikr.cover.Cover
|
||||
import org.oxycblt.musikr.fs.MimeType
|
||||
import org.oxycblt.musikr.fs.query.DeviceFile
|
||||
import org.oxycblt.musikr.tag.Disc
|
||||
|
@ -32,13 +33,19 @@ import org.oxycblt.musikr.tag.parse.ParsedTags
|
|||
import org.oxycblt.musikr.tag.util.parseId3GenreNames
|
||||
|
||||
interface TagInterpreter {
|
||||
fun interpret(file: DeviceFile, parsedTags: ParsedTags, interpretation: Interpretation): PreSong
|
||||
fun interpret(
|
||||
file: DeviceFile,
|
||||
parsedTags: ParsedTags,
|
||||
cover: Cover?,
|
||||
interpretation: Interpretation
|
||||
): PreSong
|
||||
}
|
||||
|
||||
class TagInterpreterImpl @Inject constructor() : TagInterpreter {
|
||||
override fun interpret(
|
||||
file: DeviceFile,
|
||||
parsedTags: ParsedTags,
|
||||
cover: Cover?,
|
||||
interpretation: Interpretation
|
||||
): PreSong {
|
||||
val individualPreArtists =
|
||||
|
@ -82,7 +89,8 @@ class TagInterpreterImpl @Inject constructor() : TagInterpreter {
|
|||
dateAdded = file.lastModified,
|
||||
preAlbum = preAlbum,
|
||||
preArtists = rawArtists,
|
||||
preGenres = rawGenres)
|
||||
preGenres = rawGenres,
|
||||
cover = null)
|
||||
}
|
||||
|
||||
private fun makePreAlbum(
|
||||
|
|
Loading…
Reference in a new issue