mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-29 04:42:02 +02:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user