mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-13 22:50:20 +02:00
feat: download cancellation, duplicate detection, progress tracking improvements
This commit is contained in:
@@ -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/*';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user