mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-26 12:52:40 +02:00
refactor(metadata): move cover resolution to extensions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user