Add Hi-Res authenticity check

Introduce a per-file Hi-Res authenticity checker and optional auto re-download for flagged fake Hi-Res downloads. Adds Rust checker modules (fft, evidence, FLAC/WAV decoding, tests) and a mobile API (check_hires_authenticity). Wire platform bindings for Android/iOS and PlatformBridge. Add Dart HiResCheckService, UI HiResCheckCard, settings toggle (redownloadFakeHiRes) and integration in the download pipeline to quarantine and replace suspicious files with LOSSLESS when safe. Adds claxon FLAC dependency.
This commit is contained in:
Bartolo
2026-09-23 22:29:15 +02:00
parent 83bd55bb64
commit 14ce4bc868
33 changed files with 3012 additions and 2 deletions
+5
View File
@@ -464,6 +464,11 @@ import UniformTypeIdentifiers
let filePath = args["file_path"] as! String
return try coreBackend.readFileMetadata(path: filePath, hint: args["display_name"] as? String ?? "")
case "checkHiResAuthenticity":
let args = call.arguments as! [String: Any]
let filePath = args["file_path"] as! String
return try coreBackend.checkHiResAuthenticity(path: filePath, optionsJson: args["options_json"] as? String ?? "")
case "editFileMetadata":
let args = call.arguments as! [String: Any]
let filePath = args["file_path"] as! String
+5
View File
@@ -164,6 +164,7 @@ protocol CoreBackend {
func sanitizeFilename(filename: String) -> String
func fileMetadataImplementation(path: String) -> String
func readFileMetadata(path: String, hint: String) throws -> String
func checkHiResAuthenticity(path: String, optionsJson: String) throws -> String
func editFileMetadata(path: String, metadataJson: String) throws -> String
func reEnrichFile(requestJson: String) throws -> String
func rewriteSplitArtistTags(path: String, artist: String, albumArtist: String) throws -> String
@@ -483,6 +484,10 @@ final class RustCoreBackend: CoreBackend {
try SpotiFLACBackend.readFileMetadata(path: path, hint: hint, lease: nil)
}
func checkHiResAuthenticity(path: String, optionsJson: String) throws -> String {
try SpotiFLACBackend.checkHiresAuthenticity(path: path, optionsJson: optionsJson, lease: nil)
}
func editFileMetadata(path: String, metadataJson: String) throws -> String {
try owner().editFileMetadata(path: URL(fileURLWithPath: path).resolvingSymlinksInPath().standardizedFileURL.path, metadataJson: metadataJson, lease: nil)
}