From 3160e62293c3a06609390e1dfde035a32cd6c0c8 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 5 Jan 2019 15:24:44 +0100 Subject: [PATCH] [DiscogsBridge] Fix timestamp parsing References #978 --- bridges/DiscogsBridge.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bridges/DiscogsBridge.php b/bridges/DiscogsBridge.php index 534ac083..ac128b12 100644 --- a/bridges/DiscogsBridge.php +++ b/bridges/DiscogsBridge.php @@ -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; }