musikr: add temp logging
To debug metadata issues.
This commit is contained in:
@@ -38,6 +38,7 @@ Java_org_oxycblt_musikr_metadata_TagLibJNI_openNative(JNIEnv *env,
|
||||
JVMInputStream stream {env, inputStream};
|
||||
TagLib::FileRef fileRef {&stream};
|
||||
if (fileRef.isNull()) {
|
||||
LOGE("Error opening file");
|
||||
return nullptr;
|
||||
}
|
||||
TagLib::File *file = fileRef.file();
|
||||
@@ -65,6 +66,7 @@ Java_org_oxycblt_musikr_metadata_TagLibJNI_openNative(JNIEnv *env,
|
||||
builder.setId3v2(*wavFile->ID3v2Tag());
|
||||
} else {
|
||||
// While taglib supports other formats, ExoPlayer does not. Ignore them.
|
||||
LOGE("Unsupported file format");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package org.oxycblt.musikr.pipeline
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
@@ -119,7 +120,14 @@ private class ExtractStepImpl(
|
||||
metadataExtractor
|
||||
.extract(fileWith.with)
|
||||
?.let { FileWith(fileWith.file, it) }
|
||||
.also { withContext(Dispatchers.IO) { fileWith.with.close() } }
|
||||
.also {
|
||||
if (it == null) {
|
||||
Log.d(
|
||||
"ExtractStep",
|
||||
"Failed to extract metadata for ${fileWith.file.path}")
|
||||
}
|
||||
withContext(Dispatchers.IO) { fileWith.with.close() }
|
||||
}
|
||||
}
|
||||
}
|
||||
.flowOn(Dispatchers.IO)
|
||||
|
||||
Reference in New Issue
Block a user