feat: add local library scanning with duplicate detection

- Add Go backend library scanner for FLAC, M4A, MP3, Opus, OGG files
- Read metadata from file tags (ISRC, track name, artist, album, bit depth, sample rate)
- Fallback to filename parsing when tags unavailable
- Add SQLite database for O(1) duplicate lookups
- Show 'In Library' badge on search results for existing tracks
- Match by ISRC (exact) or track name + artist (fuzzy)
- Add Library Settings page with scan, cleanup, and clear actions
- Add 30+ localization strings for library feature
This commit is contained in:
zarzet
2026-02-03 19:24:28 +07:00
parent 3d6a3f8d04
commit 26d464d3c7
29 changed files with 4377 additions and 16 deletions
@@ -892,6 +892,33 @@ class MainActivity: FlutterActivity() {
}
result.success(response)
}
// Local Library Scanning
"scanLibraryFolder" -> {
val folderPath = call.argument<String>("folder_path") ?: ""
val response = withContext(Dispatchers.IO) {
Gobackend.scanLibraryFolderJSON(folderPath)
}
result.success(response)
}
"getLibraryScanProgress" -> {
val response = withContext(Dispatchers.IO) {
Gobackend.getLibraryScanProgressJSON()
}
result.success(response)
}
"cancelLibraryScan" -> {
withContext(Dispatchers.IO) {
Gobackend.cancelLibraryScanJSON()
}
result.success(null)
}
"readAudioMetadata" -> {
val filePath = call.argument<String>("file_path") ?: ""
val response = withContext(Dispatchers.IO) {
Gobackend.readAudioMetadataJSON(filePath)
}
result.success(response)
}
else -> result.notImplemented()
}
} catch (e: Exception) {