Skip to content

Commit

Permalink
BUGFIX: Fix last modified parsing in asset proxy
Browse files Browse the repository at this point in the history
The wrong field (`time`) was parsed using the wrong format (`U`), now
it's `Date modified` using `YmdHisv`.

Fixes #9
  • Loading branch information
kdambekalns committed Sep 23, 2021
1 parent bee8ec2 commit df511e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Classes/AssetSource/CantoAssetProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function fromJsonObject(stdClass $jsonObject, CantoAssetSource $as
$assetProxy->identifier = $jsonObject->scheme . '-' . $jsonObject->id;
$assetProxy->label = $jsonObject->name;
$assetProxy->filename = $jsonObject->name;
$assetProxy->lastModified = \DateTime::createFromFormat('U', $jsonObject->time);
$assetProxy->lastModified = \DateTime::createFromFormat('YmdHisv', $jsonObject->default->{'Date modified'});
$assetProxy->fileSize = (int)$jsonObject->size;
$assetProxy->mediaType = MediaTypes::getMediaTypeFromFilename($jsonObject->name);
$assetProxy->tags = $jsonObject->tag ?? [];
Expand Down

0 comments on commit df511e2

Please sign in to comment.