musikr: reformat
This commit is contained in:
parent
652f0891fc
commit
b3c66d9b55
2 changed files with 6 additions and 2 deletions
|
@ -40,7 +40,8 @@ interface CoverStorage {
|
||||||
companion object {
|
companion object {
|
||||||
suspend fun at(dir: File): CoverStorage {
|
suspend fun at(dir: File): CoverStorage {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
if (dir.exists()) check(dir.isDirectory) { "Not a directory" } else check(dir.mkdirs()) { "Cannot create directory" }
|
if (dir.exists()) check(dir.isDirectory) { "Not a directory" }
|
||||||
|
else check(dir.mkdirs()) { "Cannot create directory" }
|
||||||
}
|
}
|
||||||
return CoverStorageImpl(dir)
|
return CoverStorageImpl(dir)
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,10 @@ class MutableStoredCovers(
|
||||||
is CoverResult.Hit -> cover.cover
|
is CoverResult.Hit -> cover.cover
|
||||||
is CoverResult.Miss -> return CoverResult.Miss()
|
is CoverResult.Miss -> return CoverResult.Miss()
|
||||||
}
|
}
|
||||||
val coverFile = coverStorage.write(cover.id + transcoding.tag) { transcoding.transcodeInto(cover.data(), it) }
|
val coverFile =
|
||||||
|
coverStorage.write(cover.id + transcoding.tag) {
|
||||||
|
transcoding.transcodeInto(cover.data(), it)
|
||||||
|
}
|
||||||
return CoverResult.Hit(coverFile)
|
return CoverResult.Hit(coverFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue