fix(download): compare size estimates at each quality tier

This commit is contained in:
zarzet
2026-09-06 21:55:38 +07:00
parent c6195bcd10
commit ba00807786
7 changed files with 102 additions and 59 deletions
+9 -3
View File
@@ -260,9 +260,15 @@ class _DownloadServicePickerState extends ConsumerState<DownloadServicePicker> {
String _sizeLabel(BuildContext context, DownloadSizeEstimate? estimate) {
if (estimate == null) return context.l10n.downloadSizeUnavailable;
final size = estimate.minBytes == estimate.maxBytes
? formatBytes(estimate.maxBytes)
: '${formatBytes(estimate.minBytes)}${formatBytes(estimate.maxBytes)}';
final size = formatBytes(estimate.bytes);
final depth = estimate.assumedBitDepth;
final rate = estimate.assumedSampleRate;
if (depth != null && rate != null) {
return context.l10n.downloadEstimatedSizeAtQuality(
size,
'$depth-bit/${formatSampleRateKHz(rate)}',
);
}
return context.l10n.downloadEstimatedSize(size);
}