[DiscogsBridge] Fix timestamp parsing

References #978
This commit is contained in:
logmanoriginal 2019-01-05 15:24:44 +01:00
parent f81d1b0846
commit 3160e62293

View file

@ -62,7 +62,11 @@ class DiscogsBridge extends BridgeAbstract {
$item['id'] = $release['id'];
$resId = array_key_exists('main_release', $release) ? $release['main_release'] : $release['id'];
$item['uri'] = self::URI . $this->getInput('artistid') . '/release/' . $resId;
$item['timestamp'] = DateTime::createFromFormat('Y', $release['year'])->getTimestamp();
if(isset($release['year'])) {
$item['timestamp'] = DateTime::createFromFormat('Y', $release['year'])->getTimestamp();
}
$item['content'] = $item['author'] . ' - ' . $item['title'];
$this->items[] = $item;
}