summaryrefslogtreecommitdiffstats
path: root/businesslayer
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-09-13 17:59:16 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-09-13 17:59:16 +0200
commitdda579ccaac67b5f360af98926a1697389bdbc6c (patch)
tree63e9dc2af7218515323dee9e56d381decd811eef /businesslayer
parent7f3a42d9493c0c9e23ad6084a77bcd164b588ad2 (diff)
also store feeds per article when doing updates
Diffstat (limited to 'businesslayer')
-rw-r--r--businesslayer/feedbusinesslayer.php8
1 files changed, 6 insertions, 2 deletions
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