mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-05 02:28:36 +02:00
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:
@@ -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") ?: ""
|
||||
|
||||
Reference in New Issue
Block a user