From dda579ccaac67b5f360af98926a1697389bdbc6c Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 13 Sep 2013 17:59:16 +0200 Subject: also store feeds per article when doing updates --- businesslayer/feedbusinesslayer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'businesslayer/feedbusinesslayer.php') diff --git a/businesslayer/feedbusinesslayer.php b/businesslayer/feedbusinesslayer.php index fca4a0c74..e337e5785 100644 --- a/businesslayer/feedbusinesslayer.php +++ b/businesslayer/feedbusinesslayer.php @@ -104,6 +104,7 @@ class FeedBusinessLayer extends BusinessLayer { // insert feed $feed->setFolderId($folderId); $feed->setUserId($userId); + $feed->setArticlesPerUpdate(count($items)); $feed = $this->mapper->insert($feed); // insert items in reverse order because the first one is usually the @@ -175,8 +176,11 @@ class FeedBusinessLayer extends BusinessLayer { list($feed, $items) = $this->feedFetcher->fetch( $existingFeed->getUrl(), false); - // keep the current faviconLink - $feed->setFaviconLink($existingFeed->getFaviconLink()); + // update number of articles on every feed update + if($existingFeed->getArticlesPerUpdate() !== count($items)) { + $existingFeed->setArticlesPerUpdate(count($items)); + $this->mapper->update($existingFeed); + } // insert items in reverse order because the first one is usually // the newest item -- cgit v1.2.3