mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-26 22:11:03 +02:00
feat(metadata): surface explicit content flag with [E] badge
Port of the explicit-content indicator from SpotiFLAC-Web (issue #456): - Go: add explicit to ExtTrackMetadata (parsed generically from any extension via explicit/is_explicit/isExplicit), TrackMetadata, and AlbumTrackMetadata; built-in Deezer maps explicit_lyrics and explicit_content_lyrics == 1 - Dart: add explicit to the Track model with a tolerant parseExplicitFlag helper wired into all backend track parsers - UI: new ExplicitBadge rendered through buildQualityBadges on album, playlist, search, and home track rows
This commit is contained in:
@@ -6,6 +6,20 @@ String? normalizeOptionalString(String? value) {
|
||||
return trimmed;
|
||||
}
|
||||
|
||||
/// Parses the parental-advisory flag from backend/extension payloads, which
|
||||
/// may arrive as a bool, a 0/1 number, or a "true"/"1" string.
|
||||
bool? parseExplicitFlag(dynamic value) {
|
||||
if (value == null) return null;
|
||||
if (value is bool) return value;
|
||||
if (value is num) return value == 1;
|
||||
if (value is String) {
|
||||
final normalized = value.trim().toLowerCase();
|
||||
if (normalized.isEmpty || normalized == 'null') return null;
|
||||
return normalized == 'true' || normalized == '1';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
final RegExp _windowsAbsolutePathPattern = RegExp(r'^[A-Za-z]:[\\/]');
|
||||
|
||||
bool _looksLikeLocalReference(String value) {
|
||||
|
||||
Reference in New Issue
Block a user