feat: download cancellation, duplicate detection, progress tracking improvements

This commit is contained in:
zarzet
2026-01-16 03:46:31 +07:00
parent 1a90887465
commit b193bc0b8f
19 changed files with 428 additions and 37 deletions
+24
View File
@@ -0,0 +1,24 @@
String audioMimeTypeForPath(String filePath) {
final dotIndex = filePath.lastIndexOf('.');
if (dotIndex == -1 || dotIndex == filePath.length - 1) {
return 'audio/*';
}
final ext = filePath.substring(dotIndex + 1).toLowerCase();
switch (ext) {
case 'flac':
return 'audio/flac';
case 'm4a':
return 'audio/mp4';
case 'mp3':
return 'audio/mpeg';
case 'ogg':
return 'audio/ogg';
case 'wav':
return 'audio/wav';
case 'aac':
return 'audio/aac';
default:
return 'audio/*';
}
}