mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-16 23:05:31 +02:00
perf(metadata): read complete SAF tags through descriptors
Add complete metadata reads with a display-name hint in Go and both native bridges. Read seekable SAF descriptors directly and use temporary copies only when direct reading fails. Add format parity tests for MP3, FLAC, M4A, and WAV plus a Dart bridge hint regression.
This commit is contained in:
@@ -13,6 +13,23 @@ void main() {
|
||||
.setMockMethodCallHandler(backendChannel, null);
|
||||
});
|
||||
|
||||
test('complete metadata forwards descriptor format hint', () async {
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
.setMockMethodCallHandler(backendChannel, (call) async {
|
||||
expect(call.method, 'readFileMetadata');
|
||||
expect(call.arguments, {
|
||||
'file_path': '/proc/self/fd/42',
|
||||
'display_name': 'Song.opus',
|
||||
});
|
||||
return jsonEncode({'replaygain_track_gain': '-6.00 dB'});
|
||||
});
|
||||
final result = await PlatformBridge.readFileMetadata(
|
||||
'/proc/self/fd/42',
|
||||
displayName: 'Song.opus',
|
||||
);
|
||||
expect(result['replaygain_track_gain'], '-6.00 dB');
|
||||
});
|
||||
|
||||
test('display metadata uses the lightweight scan result directly', () async {
|
||||
final invokedMethods = <String>[];
|
||||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
|
||||
|
||||
Reference in New Issue
Block a user