1
0
Fork 0
forked from blallo/rss-bridge

discogs: avoid negative timestamp

This commit is contained in:
boyska 2018-08-19 18:07:06 +02:00
parent 3bd64b905f
commit 756ec7610d

View file

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