refactor(metadata): move cover resolution to extensions

This commit is contained in:
zarzet
2026-08-19 13:12:29 +07:00
parent bdb10a2ae6
commit ea63291db8
49 changed files with 42 additions and 579 deletions
@@ -1393,10 +1393,9 @@ class MainActivity: FlutterFragmentActivity() {
"downloadCoverToFile" -> {
val coverUrl = call.argument<String>("cover_url") ?: ""
val outputPath = call.argument<String>("output_path") ?: ""
val maxQuality = call.argument<Boolean>("max_quality") ?: true
val response = withContext(Dispatchers.IO) {
try {
Gobackend.downloadCoverToFile(coverUrl, outputPath, maxQuality)
Gobackend.downloadCoverToFile(coverUrl, outputPath, false)
"""{"success":true}"""
} catch (e: Exception) {
"""{"success":false,"error":"${e.message?.replace("\"", "'")}"}"""
@@ -503,7 +503,7 @@ internal fun NativeDownloadFinalizer.downloadCoverForMetadata(context: Context,
Gobackend.downloadCoverToFile(
coverUrl,
output.absolutePath,
input.request.optBoolean("embed_max_quality_cover", true)
false
)
if (output.exists() && output.length() > 0L) {
output