feat(metadata): manual MusicBrainz lookup in the tag editor

The Go MusicBrainz genre and album-artist ISRC lookups only ran
automatically at download time. The tag editor's auto-fill section
gains a Fetch from MusicBrainz button that bridges both exports in one
channel call (sparing the 1 req/s budget) and fills the fields as
editable suggestions; nothing is written until Save.
This commit is contained in:
zarzet
2026-07-26 19:21:32 +07:00
parent fa7ef84b39
commit 97b87472fe
17 changed files with 298 additions and 0 deletions
@@ -3387,6 +3387,27 @@ class MainActivity: FlutterFragmentActivity() {
}
result.success(response)
}
"fetchMusicBrainzTags" -> {
val isrc = call.argument<String>("isrc") ?: ""
val albumName = call.argument<String>("album_name") ?: ""
val response = withContext(Dispatchers.IO) {
val genre = try {
Gobackend.fetchMusicBrainzGenreByISRC(isrc)
} catch (_: Exception) {
""
}
val albumArtist = try {
Gobackend.fetchMusicBrainzAlbumArtistByISRC(isrc, albumName)
} catch (_: Exception) {
""
}
JSONObject()
.put("genre", genre)
.put("album_artist", albumArtist)
.toString()
}
result.success(response)
}
"runPostProcessingV2" -> {
val inputJson = call.argument<String>("input") ?: ""
val metadataJson = call.argument<String>("metadata") ?: ""