mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-25 05:20:59 +02:00
feat: add artist tag mode setting with split Vorbis support and improve library scan progress
- Add artist_tag_mode setting (joined / split_vorbis) for FLAC/Opus multi-artist tags - Split 'Artist A, Artist B' into separate ARTIST= Vorbis comments when split mode is enabled - Join repeated ARTIST/ALBUMARTIST Vorbis comments when reading metadata - Propagate artistTagMode through download pipeline, re-enrich, and metadata editor - Improve library scan progress: separate polling intervals, finalizing state, indeterminate progress - Add initial progress snapshot on library scan stream connect - Use req.ArtistName consistently for Qobuz downloads instead of track.Performer.Name - Add l10n keys for artist tag mode, library files unit, and scan finalizing status
This commit is contained in:
@@ -3,6 +3,9 @@ final RegExp _artistNameSplitPattern = RegExp(
|
||||
caseSensitive: false,
|
||||
);
|
||||
|
||||
const artistTagModeJoined = 'joined';
|
||||
const artistTagModeSplitVorbis = 'split_vorbis';
|
||||
|
||||
List<String> splitArtistNames(String rawArtists) {
|
||||
final raw = rawArtists.trim();
|
||||
if (raw.isEmpty) return const [];
|
||||
@@ -13,3 +16,25 @@ List<String> splitArtistNames(String rawArtists) {
|
||||
.where((part) => part.isNotEmpty)
|
||||
.toList(growable: false);
|
||||
}
|
||||
|
||||
bool shouldSplitVorbisArtistTags(String mode) {
|
||||
return mode == artistTagModeSplitVorbis;
|
||||
}
|
||||
|
||||
List<String> splitArtistTagValues(String rawArtists) {
|
||||
final seen = <String>{};
|
||||
final values = <String>[];
|
||||
for (final part in splitArtistNames(rawArtists)) {
|
||||
final key = part.toLowerCase();
|
||||
if (seen.add(key)) {
|
||||
values.add(part);
|
||||
}
|
||||
}
|
||||
|
||||
if (values.isNotEmpty) {
|
||||
return values;
|
||||
}
|
||||
|
||||
final trimmed = rawArtists.trim();
|
||||
return trimmed.isEmpty ? const [] : <String>[trimmed];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user