musikr: cleanup
This commit is contained in:
parent
70b26dfb63
commit
9937e773a3
1 changed files with 0 additions and 4 deletions
|
@ -32,16 +32,12 @@ import org.oxycblt.musikr.metadata.Metadata
|
||||||
|
|
||||||
open class FolderCovers(private val context: Context) : Covers<FolderCover> {
|
open class FolderCovers(private val context: Context) : Covers<FolderCover> {
|
||||||
override suspend fun obtain(id: String): CoverResult<FolderCover> {
|
override suspend fun obtain(id: String): CoverResult<FolderCover> {
|
||||||
// Parse the ID to get the directory URI
|
|
||||||
if (!id.startsWith("folder:")) {
|
if (!id.startsWith("folder:")) {
|
||||||
return CoverResult.Miss()
|
return CoverResult.Miss()
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Check if the dir actually exists still to avoid stale uris
|
|
||||||
val directoryUri = id.substring("folder:".length)
|
val directoryUri = id.substring("folder:".length)
|
||||||
val uri = Uri.parse(directoryUri)
|
val uri = Uri.parse(directoryUri)
|
||||||
|
|
||||||
// Check if the URI is still valid
|
|
||||||
val exists =
|
val exists =
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue