mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-29 23:38:50 +02:00
refactor(backend): drop dead exports/availability path and dedup Go tag writers
Remove the never-called checkAvailability chain end to end (Dart bridge + provider, Android/iOS MethodChannel handlers, Go exports) and stop restoring its persistent lookup cache on every cold start; the legacy prefs key is cleared on next cache reset. Delete dead Go: romaji.go (test-only), the no-op pre-warm chain (PreWarmTrackCache/PreWarmCache/…), retired Download stubs, and a batch of exports with no Dart/Kotlin/Swift/Go caller. Kept GetTrackCacheSize/ ClearTrackIDCache (Settings cache screen), SetAllowedDownloadDirs and Clear/GetItemProgress (live test seams). Dedup: single updateFlacVorbis + replaceFlacPictures helper behind the six FLAC tag writers; merge byte-identical extractCommentFrame/extractLyricsFrame into extractLangTextFrame. go build/vet + 237 go tests, flutter analyze + tests green.
This commit is contained in:
@@ -2198,14 +2198,6 @@ class MainActivity: FlutterFragmentActivity() {
|
||||
}
|
||||
result.success(null)
|
||||
}
|
||||
"checkAvailability" -> {
|
||||
val spotifyId = call.argument<String>("spotify_id") ?: ""
|
||||
val isrc = call.argument<String>("isrc") ?: ""
|
||||
val response = withContext(Dispatchers.IO) {
|
||||
Gobackend.checkAvailability(spotifyId, isrc)
|
||||
}
|
||||
result.success(response)
|
||||
}
|
||||
"downloadByStrategy" -> {
|
||||
val requestJson = call.arguments as String
|
||||
val response = withContext(Dispatchers.IO) {
|
||||
@@ -3038,13 +3030,6 @@ class MainActivity: FlutterFragmentActivity() {
|
||||
}
|
||||
result.success(payload)
|
||||
}
|
||||
"preWarmTrackCache" -> {
|
||||
val tracksJson = call.argument<String>("tracks") ?: "[]"
|
||||
withContext(Dispatchers.IO) {
|
||||
Gobackend.preWarmTrackCacheJSON(tracksJson)
|
||||
}
|
||||
result.success(null)
|
||||
}
|
||||
"getTrackCacheSize" -> {
|
||||
val size = withContext(Dispatchers.IO) {
|
||||
Gobackend.getTrackCacheSize()
|
||||
@@ -3097,22 +3082,6 @@ class MainActivity: FlutterFragmentActivity() {
|
||||
}
|
||||
result.success(response)
|
||||
}
|
||||
"checkAvailabilityFromDeezerID" -> {
|
||||
val deezerTrackId = call.argument<String>("deezer_track_id") ?: ""
|
||||
val response = withContext(Dispatchers.IO) {
|
||||
Gobackend.checkAvailabilityFromDeezerID(deezerTrackId)
|
||||
}
|
||||
result.success(response)
|
||||
}
|
||||
"checkAvailabilityByPlatformID" -> {
|
||||
val platform = call.argument<String>("platform") ?: ""
|
||||
val entityType = call.argument<String>("entity_type") ?: ""
|
||||
val entityId = call.argument<String>("entity_id") ?: ""
|
||||
val response = withContext(Dispatchers.IO) {
|
||||
Gobackend.checkAvailabilityByPlatformID(platform, entityType, entityId)
|
||||
}
|
||||
result.success(response)
|
||||
}
|
||||
"getSpotifyIDFromDeezerTrack" -> {
|
||||
val deezerTrackId = call.argument<String>("deezer_track_id") ?: ""
|
||||
val response = withContext(Dispatchers.IO) {
|
||||
|
||||
Reference in New Issue
Block a user