From fae882f834409e18174e05d19deea39a3bf01e7b Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 20 Nov 2015 18:48:41 +0100 Subject: add a fingerprint for all articles --- db/item.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'db') diff --git a/db/item.php b/db/item.php index c66b68a33..91b3215a6 100644 --- a/db/item.php +++ b/db/item.php @@ -61,6 +61,7 @@ class Item extends Entity implements IAPI, \JsonSerializable { protected $lastModified; protected $searchIndex; protected $rtl; + protected $fingerprint; public function __construct(){ $this->addType('pubDate', 'integer'); @@ -214,6 +215,11 @@ class Item extends Entity implements IAPI, \JsonSerializable { $this->getUrl() ) ); + $this->setFingerprint($this->computeFingerprint()); + } + + private function computeFingerprint() { + return md5($this->getTitle() . $this->getUrl() . $this->getBody()); } public function setUrl($url) { -- cgit v1.2.3