From d78c240a428a257260fb240a0c0e92e02c38590d Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Thu, 10 Sep 2015 23:01:48 -0700 Subject: [PATCH] T357: Gracefully handle obviously invalid year tags. --- app/commands/ImportMLPMA.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/commands/ImportMLPMA.php b/app/commands/ImportMLPMA.php index 4550d9d6..17f91243 100644 --- a/app/commands/ImportMLPMA.php +++ b/app/commands/ImportMLPMA.php @@ -173,6 +173,10 @@ class ImportMLPMA extends Command { if ($taggedYear !== null && $modifiedDate->year === $taggedYear) { $releasedAt = $modifiedDate; + } else if ($taggedYear !== null && (string) $taggedYear !== 4) { + $this->error('This track\'s tagged year makes no sense! Using the track\'s last modified date...'); + $releasedAt = $modifiedDate; + } else if ($taggedYear !== null && $modifiedDate->year !== $taggedYear) { $this->error('Release years don\'t match! Using the tagged year...'); $releasedAt = Carbon::create($taggedYear);