From 7faa4afb1e7b8e94c7e3fdb953cfe92fc81f0249 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 27 Mar 2023 11:57:44 -0700 Subject: [PATCH] takeout: keep TrackCreateDate Signed-off-by: Varun Patil --- lib/Command/MigrateGoogleTakeout.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Command/MigrateGoogleTakeout.php b/lib/Command/MigrateGoogleTakeout.php index faff0f1d..159ef86a 100644 --- a/lib/Command/MigrateGoogleTakeout.php +++ b/lib/Command/MigrateGoogleTakeout.php @@ -245,6 +245,12 @@ class MigrateGoogleTakeout extends Command $txf = array_filter($txf, function ($value, $key) use ($exif) { return !isset($exif[$key]); }, ARRAY_FILTER_USE_BOTH); + + // Videos may not have DateTimeOriginal but have TrackCreateDate, + // in that case do not override it + if (isset($exif['TrackCreateDate'])) { + unset($txf['DateTimeOriginal']); + } } // Special case: if $txf has both GPSLatitude and GPSLongitude,