fix(metadata): match by primary artist and review results #511

This commit is contained in:
zarzet
2026-08-11 16:20:03 +07:00
parent dacc5abde0
commit 28538395c2
5 changed files with 325 additions and 29 deletions
+24
View File
@@ -0,0 +1,24 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:spotiflac_android/utils/artist_utils.dart';
void main() {
test('primary artist prefers the first album artist', () {
expect(
primaryArtistName(
'Track Artist, Guest Artist',
albumArtist: 'Album Artist & Collaborator',
),
'Album Artist',
);
});
test('primary artist handles provider separator variants', () {
expect(primaryArtistName('One; Two & Three'), 'One');
expect(primaryArtistName('One feat. Two'), 'One');
expect(primaryArtistName('AC/DC'), 'AC/DC');
expect(
primaryArtistName('Actual Artist, Guest', albumArtist: 'Various Artists'),
'Actual Artist',
);
});
}