mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-29 08:07:59 +01:00
Merge rPFd78c240a428a: T357: Gracefully handle obviously invalid year tags.
This commit is contained in:
parent
1952f01601
commit
2ac9fd6967
1 changed files with 12 additions and 8 deletions
|
@ -177,7 +177,10 @@ class ImportMLPMA extends Command
|
||||||
|
|
||||||
if ($taggedYear !== null && $modifiedDate->year === $taggedYear) {
|
if ($taggedYear !== null && $modifiedDate->year === $taggedYear) {
|
||||||
$releasedAt = $modifiedDate;
|
$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 {
|
} else {
|
||||||
if ($taggedYear !== null && $modifiedDate->year !== $taggedYear) {
|
if ($taggedYear !== null && $modifiedDate->year !== $taggedYear) {
|
||||||
$this->error('Release years don\'t match! Using the tagged year...');
|
$this->error('Release years don\'t match! Using the tagged year...');
|
||||||
|
@ -189,6 +192,7 @@ class ImportMLPMA extends Command
|
||||||
$releasedAt = $modifiedDate;
|
$releasedAt = $modifiedDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This is later used by the classification/publishing script to determine the publication date.
|
// This is later used by the classification/publishing script to determine the publication date.
|
||||||
$parsedTags['released_at'] = $releasedAt->toDateTimeString();
|
$parsedTags['released_at'] = $releasedAt->toDateTimeString();
|
||||||
|
|
Loading…
Reference in a new issue