Skip to content

Commit

Permalink
Add support for AVI videos (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierlacan authored Mar 4, 2021
1 parent e670e27 commit 80c7c67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ This tool currently only extracts the following "media file" types. Any other fi
- .jpeg
- .gif
- .mp4
- .avi

## What does the tool do?

Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class GooglePhotosExif extends Command {
const jpegs = mediaFiles.filter(mediaFile => mediaFile.mediaFileExtension.toLowerCase() === '.jpeg' || mediaFile.mediaFileExtension.toLowerCase() === '.jpg');
const gifs = mediaFiles.filter(mediaFile => mediaFile.mediaFileExtension.toLowerCase() === '.gif');
const mp4s = mediaFiles.filter(mediaFile => mediaFile.mediaFileExtension.toLowerCase() === '.mp4');
this.log(`--- Found ${jpegs.length} JPEGs, ${gifs.length} GIFs and ${mp4s.length} MP4s ---`);
const avis = mediaFiles.filter(mediaFile => mediaFile.mediaFileExtension.toLowerCase() === '.avi');
this.log(`--- Found ${jpegs.length} JPEGs, ${gifs.length} GIFs and ${mp4s.length} MP4s and ${avis.length} AVIs ---`);

this.log(`--- Processing media files ---`);
const fileNamesWithEditedExif: string[] = [];
Expand Down Expand Up @@ -114,7 +115,7 @@ class GooglePhotosExif extends Command {
}

// Log a summary
this.log(`--- Processed ${mediaFiles.length} media files (${jpegs.length} JPEGs, ${gifs.length} GIFs and ${mp4s.length} MP4s) ---`);
this.log(`--- Processed ${mediaFiles.length} media files (${jpegs.length} JPEGs, ${gifs.length} GIFs and ${mp4s.length} MP4s and ${avis.length} AVIs) ---`);
this.log(`--- The file modified timestamp has been updated on all media files ---`)
if (fileNamesWithEditedExif.length > 0) {
this.log(`--- Found ${fileNamesWithEditedExif.length} files which support EXIF, but had no DateTimeOriginal field. For each of the following files, the DateTimeOriginalField has been updated using the date found in the JSON metadata: ---`);
Expand Down
2 changes: 1 addition & 1 deletion src/models/supported-media-file-extensions.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SUPPORTED_MEDIA_FILE_EXTENSIONS = ['.jpeg', '.jpg', '.gif', '.mp4'];
export const SUPPORTED_MEDIA_FILE_EXTENSIONS = ['.jpeg', '.jpg', '.gif', '.mp4', '.avi'];

0 comments on commit 80c7c67

Please sign in to comment.