mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-04-09 10:15:44 +02:00
also consider enclosure for fingerprint
This commit is contained in:
parent
52b701c8d4
commit
052178a79f
@ -221,7 +221,8 @@ class Item extends Entity implements IAPI, \JsonSerializable {
|
||||
}
|
||||
|
||||
private function computeFingerprint() {
|
||||
return md5($this->getTitle() . $this->getUrl() . $this->getBody());
|
||||
return md5($this->getTitle() . $this->getUrl() . $this->getBody() .
|
||||
$this->getEnclosureLink());
|
||||
}
|
||||
|
||||
public function setUrl($url) {
|
||||
|
@ -293,13 +293,17 @@ class ItemTest extends \PHPUnit_Framework_TestCase {
|
||||
$title = 'a';
|
||||
$body = 'b';
|
||||
$url = 'http://google.com';
|
||||
$link = 'ho';
|
||||
|
||||
$item = new Item();
|
||||
$item->setBody($body);
|
||||
$item->setTitle($title);
|
||||
$item->setUrl($url);
|
||||
$item->setEnclosureLink($link);
|
||||
$item->generateSearchIndex();
|
||||
|
||||
$this->assertEquals(md5($title . $url . $body), $item->getFingerprint());
|
||||
$this->assertEquals(md5($title . $url . $body . $link),
|
||||
$item->getFingerprint());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -222,7 +222,6 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
|
||||
$item->setGuidHash($this->guid);
|
||||
$item->setBody($this->body);
|
||||
$item->setLastModified($this->time);
|
||||
$item->generateSearchIndex();
|
||||
$item->setRtl(false);
|
||||
|
||||
$this->expectItem('getAuthor', $this->author);
|
||||
@ -235,6 +234,8 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase {
|
||||
$item->setEnclosureMime($enclosureType);
|
||||
$item->setEnclosureLink($this->enclosureLink);
|
||||
}
|
||||
$item->generateSearchIndex();
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user