From df511e23b9bb316f0d85429d838c87a904f7541b Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Thu, 23 Sep 2021 15:47:13 +0200 Subject: [PATCH] BUGFIX: Fix last modified parsing in asset proxy The wrong field (`time`) was parsed using the wrong format (`U`), now it's `Date modified` using `YmdHisv`. Fixes #9 --- Classes/AssetSource/CantoAssetProxy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/AssetSource/CantoAssetProxy.php b/Classes/AssetSource/CantoAssetProxy.php index 63c8999..4f96544 100644 --- a/Classes/AssetSource/CantoAssetProxy.php +++ b/Classes/AssetSource/CantoAssetProxy.php @@ -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 ?? [];