mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-26 21:02:28 +02:00
feat(library): add combined quality label #511
This commit is contained in:
@@ -40,6 +40,12 @@ void main() {
|
||||
normalizeLibraryQualityLabelMode('unsupported'),
|
||||
AppSettings.libraryQualityLabelBitrate,
|
||||
);
|
||||
expect(
|
||||
normalizeLibraryQualityLabelMode(
|
||||
AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
),
|
||||
AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
);
|
||||
});
|
||||
|
||||
test('restores legacy bit depth and sample rate labels', () {
|
||||
@@ -68,6 +74,32 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('combines bit depth and measured bitrate for lossless audio', () {
|
||||
expect(
|
||||
buildLibraryAudioQualityLabel(
|
||||
mode: AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
format: 'flac',
|
||||
bitrateKbps: 1760,
|
||||
bitDepth: 24,
|
||||
sampleRate: 48000,
|
||||
),
|
||||
'24-bit/1760kbps',
|
||||
);
|
||||
});
|
||||
|
||||
test('keeps lossy audio on bitrate in the combined mode', () {
|
||||
expect(
|
||||
buildLibraryAudioQualityLabel(
|
||||
mode: AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
format: 'aac',
|
||||
bitrateKbps: 256,
|
||||
bitDepth: 16,
|
||||
sampleRate: 44100,
|
||||
),
|
||||
'AAC 256kbps',
|
||||
);
|
||||
});
|
||||
|
||||
test('falls back when the preferred metadata is unavailable', () {
|
||||
expect(
|
||||
buildLibraryAudioQualityLabel(
|
||||
@@ -83,7 +115,24 @@ void main() {
|
||||
mode: AppSettings.libraryQualityLabelBitrate,
|
||||
storedQuality: '24-bit/96kHz',
|
||||
),
|
||||
'24-bit/96kHz',
|
||||
isNull,
|
||||
);
|
||||
expect(
|
||||
buildLibraryAudioQualityLabel(
|
||||
mode: AppSettings.libraryQualityLabelBitrate,
|
||||
format: 'flac',
|
||||
storedQuality: 'FLAC 1411kbps',
|
||||
),
|
||||
'FLAC 1411kbps',
|
||||
);
|
||||
expect(
|
||||
buildLibraryAudioQualityLabel(
|
||||
mode: AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
format: 'flac',
|
||||
bitDepth: 24,
|
||||
storedQuality: 'FLAC 1411kbps',
|
||||
),
|
||||
'24-bit/1411kbps',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -694,7 +694,7 @@ void main() {
|
||||
lyricsAppleElrcWordSync: true,
|
||||
deduplicateDownloads: false,
|
||||
allowQualityVariants: true,
|
||||
libraryQualityLabelMode: AppSettings.libraryQualityLabelBitDepth,
|
||||
libraryQualityLabelMode: AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
clearDownloadFallbackExtensionIds: true,
|
||||
clearSearchProvider: true,
|
||||
clearHomeFeedProvider: true,
|
||||
@@ -708,7 +708,7 @@ void main() {
|
||||
expect(updated.allowQualityVariants, isTrue);
|
||||
expect(
|
||||
updated.libraryQualityLabelMode,
|
||||
AppSettings.libraryQualityLabelBitDepth,
|
||||
AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
);
|
||||
expect(updated.downloadFallbackExtensionIds, isNull);
|
||||
expect(updated.searchProvider, isNull);
|
||||
@@ -739,7 +739,7 @@ void main() {
|
||||
autoConvertDownloads: true,
|
||||
autoConvertFormat: 'opus',
|
||||
autoConvertBitrate: '192k',
|
||||
libraryQualityLabelMode: AppSettings.libraryQualityLabelBitDepth,
|
||||
libraryQualityLabelMode: AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
);
|
||||
|
||||
final decoded = AppSettings.fromJson(settings.toJson());
|
||||
@@ -761,7 +761,7 @@ void main() {
|
||||
expect(decoded.lastSeenVersion, '4.5.0');
|
||||
expect(
|
||||
decoded.libraryQualityLabelMode,
|
||||
AppSettings.libraryQualityLabelBitDepth,
|
||||
AppSettings.libraryQualityLabelBitDepthBitrate,
|
||||
);
|
||||
expect(decoded.deduplicateDownloads, isFalse);
|
||||
expect(decoded.allowQualityVariants, isTrue);
|
||||
|
||||
Reference in New Issue
Block a user