takeout: fix video dates (fix #910)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/merge
Varun Patil 2023-11-09 23:43:16 -08:00
parent 183de24e62
commit 6c42d0b8a4
1 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ use Symfony\Component\Console\Output\OutputInterface;
class MigrateGoogleTakeout extends Command class MigrateGoogleTakeout extends Command
{ {
protected const MIGRATOR_VERSION = 1; protected const MIGRATOR_VERSION = 2;
protected const MIGRATED_KEY = 'memoriesMigratorVersion'; protected const MIGRATED_KEY = 'memoriesMigratorVersion';
protected OutputInterface $output; protected OutputInterface $output;
@ -239,10 +239,10 @@ class MigrateGoogleTakeout extends Command
return !isset($exif[$key]); return !isset($exif[$key]);
}, ARRAY_FILTER_USE_BOTH); }, ARRAY_FILTER_USE_BOTH);
// Videos may not have DateTimeOriginal but have TrackCreateDate, // The AllDates field does not actually exist but
// in that case do not override it // sets DateTimeOriginal or TrackCreateDate
if (isset($exif['TrackCreateDate'])) { if (isset($exif['TrackCreateDate']) || isset($exif['DateTimeOriginal'])) {
unset($txf['DateTimeOriginal']); unset($txf['AllDates']);
} }
} }
@ -326,7 +326,7 @@ class MigrateGoogleTakeout extends Command
if (is_numeric($epoch)) { if (is_numeric($epoch)) {
$date = new \DateTime(); $date = new \DateTime();
$date->setTimestamp((int) $epoch); $date->setTimestamp((int) $epoch);
$txf['DateTimeOriginal'] = $date->format('Y:m:d H:i:s'); $txf['AllDates'] = $date->format('Y:m:d H:i:s');
} }
// Location coordinates // Location coordinates