mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-03-31 09:01:33 +02:00
16 lines
427 B
Dart
16 lines
427 B
Dart
final RegExp _artistNameSplitPattern = RegExp(
|
|
r'\s*(?:,|&|\bx\b)\s*|\s+\b(?:feat(?:uring)?|ft|with)\.?(?=\s|$)\s*',
|
|
caseSensitive: false,
|
|
);
|
|
|
|
List<String> splitArtistNames(String rawArtists) {
|
|
final raw = rawArtists.trim();
|
|
if (raw.isEmpty) return const [];
|
|
|
|
return raw
|
|
.split(_artistNameSplitPattern)
|
|
.map((part) => part.trim())
|
|
.where((part) => part.isNotEmpty)
|
|
.toList(growable: false);
|
|
}
|