mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Transfer repository from Gitlab
This commit is contained in:
parent
af2efbdbbd
commit
568cc243f0
177 changed files with 13300 additions and 0 deletions
33
mobile/lib/utils/files_helper.dart
Normal file
33
mobile/lib/utils/files_helper.dart
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import 'package:path/path.dart' as p;
|
||||
|
||||
class FileHelper {
|
||||
static getMimeType(String filePath) {
|
||||
var fileExtension = p.extension(filePath).split(".")[1];
|
||||
|
||||
switch (fileExtension) {
|
||||
case 'gif':
|
||||
return {"type": "image", "subType": "gif"};
|
||||
|
||||
case 'jpeg':
|
||||
return {"type": "image", "subType": "jpeg"};
|
||||
|
||||
case 'jpg':
|
||||
return {"type": "image", "subType": "jpeg"};
|
||||
|
||||
case 'png':
|
||||
return {"type": "image", "subType": "png"};
|
||||
|
||||
case 'mov':
|
||||
return {"type": "video", "subType": "quicktime"};
|
||||
|
||||
case 'mp4':
|
||||
return {"type": "video", "subType": "mp4"};
|
||||
|
||||
case 'avi':
|
||||
return {"type": "video", "subType": "x-msvideo"};
|
||||
|
||||
default:
|
||||
return {"type": "unsupport", "subType": "unsupport"};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue