musikr: fix broken fscovers impl
This commit is contained in:
parent
93953aee8b
commit
a3722acb5a
1 changed files with 3 additions and 3 deletions
|
@ -101,7 +101,7 @@ class MutableFSCovers(private val context: Context) : MutableCovers<FDCover> {
|
||||||
val bestCover =
|
val bestCover =
|
||||||
parent.children
|
parent.children
|
||||||
.filterIsInstance<DeviceFile>()
|
.filterIsInstance<DeviceFile>()
|
||||||
.map { it to coverArtScore(file) }
|
.map { it to coverArtScore(it) }
|
||||||
.maxBy { it.second }
|
.maxBy { it.second }
|
||||||
if (bestCover.second > 0) {
|
if (bestCover.second > 0) {
|
||||||
return CoverResult.Hit(FolderCoverImpl(context, bestCover.first.uri))
|
return CoverResult.Hit(FolderCoverImpl(context, bestCover.first.uri))
|
||||||
|
@ -136,9 +136,9 @@ class MutableFSCovers(private val context: Context) : MutableCovers<FDCover> {
|
||||||
// Multiply the score for preferred formats & extensions. Weirder formats are harder for
|
// Multiply the score for preferred formats & extensions. Weirder formats are harder for
|
||||||
// android to decode, but not the end of the world.
|
// android to decode, but not the end of the world.
|
||||||
score *=
|
score *=
|
||||||
max(preferredFormats.indexOfFirst { file.mimeType.equals(it, ignoreCase = true) }, 0)
|
max(preferredFormats.indexOfFirst { file.mimeType.equals(it, ignoreCase = true) }, 1)
|
||||||
score *=
|
score *=
|
||||||
max(preferredExtensions.indexOfFirst { extension.equals(it, ignoreCase = true) }, 0)
|
max(preferredExtensions.indexOfFirst { extension.equals(it, ignoreCase = true) }, 1)
|
||||||
return score
|
return score
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue