mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-02 17:18:36 +02:00
feat(metadata): show average bitrate for lossless files in the track screen
This commit is contained in:
@@ -706,6 +706,27 @@ extension _TrackMetadataCards on _TrackMetadataScreenState {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!_isBitrateFormatLabel(fileExtension) &&
|
||||
_audioBitrate != null &&
|
||||
_audioBitrate! > 0)
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.tertiaryContainer,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Text(
|
||||
'${_audioBitrate}kbps',
|
||||
style: TextStyle(
|
||||
color: colorScheme.onTertiaryContainer,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
|
||||
@@ -315,11 +315,11 @@ class _TrackMetadataScreenState extends ConsumerState<TrackMetadataScreen>
|
||||
final formatChanged =
|
||||
resolvedFormat != null &&
|
||||
resolvedFormat != normalizeAudioFormatValue(storedFormat);
|
||||
final resolvedBitrate = _isBitrateFormatValue(resolvedFormat)
|
||||
? _readPlausibleBitrateKbps(
|
||||
metadata['bitrate'] ?? metadata['bit_rate'],
|
||||
)
|
||||
: null;
|
||||
// Lossless files carry an average bitrate too (computed by the backend
|
||||
// from file size / duration) — useful for spotting fake 24-bit rips.
|
||||
final resolvedBitrate = _readPlausibleBitrateKbps(
|
||||
metadata['bitrate'] ?? metadata['bit_rate'],
|
||||
);
|
||||
final resolvedDuration = readPositiveInt(metadata['duration']);
|
||||
final resolvedAlbum = metadata['album']?.toString();
|
||||
final resolvedTitle = metadata['title']?.toString();
|
||||
|
||||
Reference in New Issue
Block a user