Improve filename to datetime parsing for video files

This commit is contained in:
Neeraj Gupta 2021-09-22 11:48:48 +05:30
parent abfcf95713
commit fa4480eb44
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
2 changed files with 2 additions and 0 deletions

View file

@ -60,6 +60,7 @@ class File {
final parsedDateTime = DateTime.parse(
basenameWithoutExtension(file.title)
.replaceAll("IMG_", "")
.replaceAll("VID_", "")
.replaceAll("DCIM_", "")
.replaceAll("_", " "));
file.creationTime = parsedDateTime.microsecondsSinceEpoch;

View file

@ -101,6 +101,7 @@ DateTime parseDateFromFileName(String fileName) {
} else {
return DateTime.tryParse((fileName)
.replaceAll("IMG_", "")
.replaceAll("VID_", "")
.replaceAll("DCIM_", "")
.replaceAll("_", " "));
}