mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-13 19:21:23 +02:00
fix: preserve extended metadata during fallback, accurate lossy quality display, SAF improvements
- Add Genre/Label/Copyright fields to DownloadResult struct - buildDownloadSuccessResponse now prefers service result metadata over request - enrichRequestExtendedMetadata fetches Deezer metadata by ISRC before download - Flutter sends copyright in download request payload - History merge preserves existing genre/label/copyright on re-download - Accurate MP3 duration via Xing/VBRI VBR headers, MPEG2/2.5 bitrate tables - Accurate Opus/Vorbis duration via last Ogg page granule position - Bitrate field added to LibraryScanResult, LocalLibraryItem, DB v4 migration - Lossy formats display format+bitrate instead of fake 16-bit quality - Local library file date uses fileModTime instead of scannedAt - SAF URI recovery for transient FD paths after download - Improved SAF repair and download history path matching in library scan - Extract quality probe logic into reusable enrichResultQualityFromFile
This commit is contained in:
1 parent
abc599d7f9
commit
a1d1ab1f0f
10 files changed
+589
-143
No files matched your search
@@ -70,7 +70,12 @@ class UnifiedLibraryItem {
|
||||
|
||||
factory UnifiedLibraryItem.fromLocalLibrary(LocalLibraryItem item) {
|
||||
String? quality;
|
||||
if (item.bitDepth != null && item.sampleRate != null) {
|
||||
if (item.bitrate != null && item.bitrate! > 0) {
|
||||
// Lossy format with bitrate
|
||||
final fmt = item.format?.toUpperCase() ?? '';
|
||||
quality = '$fmt ${item.bitrate}kbps'.trim();
|
||||
} else if (item.bitDepth != null && item.bitDepth! > 0 && item.sampleRate != null) {
|
||||
// Lossless format with actual bit depth
|
||||
quality =
|
||||
'${item.bitDepth}bit/${(item.sampleRate! / 1000).toStringAsFixed(1)}kHz';
|
||||
}
|
||||
@@ -897,7 +902,10 @@ class _QueueTabState extends ConsumerState<QueueTab> {
|
||||
}
|
||||
|
||||
String? _localQualityLabel(LocalLibraryItem item) {
|
||||
if (item.bitDepth == null || item.sampleRate == null) {
|
||||
if (item.bitrate != null && item.bitrate! > 0) {
|
||||
return '${item.bitrate}kbps';
|
||||
}
|
||||
if (item.bitDepth == null || item.bitDepth == 0 || item.sampleRate == null) {
|
||||
return null;
|
||||
}
|
||||
return '${item.bitDepth}bit/${(item.sampleRate! / 1000).toStringAsFixed(1)}kHz';
|
||||
|
||||
Reference in new issue
Block a user