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