actualizeFeed return number of new articles as 3rd

pull/1517/head
Seokseong Jeon 8 years ago
parent be0bcfef7e
commit 09787cfd7a
  1. 4
      app/Controllers/feedController.php
  2. 4
      cli/actualize-user.php

@ -254,6 +254,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$pshbMinAge = time() - (3600 * 24); //TODO: Make a configuration.
$updated_feeds = 0;
$nb_new_articles = 0;
$is_read = FreshRSS_Context::$user_conf->mark_when['reception'] ? 1 : 0;
foreach ($feeds as $feed) {
$url = $feed->url(); //For detection of HTTP 301
@ -372,6 +373,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$entryDAO->beginTransaction();
}
$entryDAO->addEntry($entry->toArray());
$nb_new_articles++;
}
}
$entryDAO->updateLastSeen($feed->id(), $oldGuids, $mtime);
@ -434,7 +436,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
break;
}
}
return array($updated_feeds, reset($feeds));
return array($updated_feeds, reset($feeds), $nb_new_articles);
}
/**

@ -14,9 +14,9 @@ $username = cliInitUser($options['user']);
fwrite(STDERR, 'FreshRSS actualizing user “' . $username . "”…\n");
list($nbUpdatedFeeds, $feed) = FreshRSS_feed_Controller::actualizeFeed(0, '', true);
list($nbUpdatedFeeds, $feed, $nbNewArticles) = FreshRSS_feed_Controller::actualizeFeed(0, '', true);
echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username\n";
echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username ($nbNewArticles new articles)\n";
invalidateHttpCache($username);

Loading…
Cancel
Save