|
|
@@ -7,9 +7,11 @@ performRequirementCheck(FreshRSS_Context::systemConf()->db['type'] ?? '');
|
|
|
|
|
|
$cliOptions = new class extends CliOptionsParser {
|
|
|
public string $user;
|
|
|
+ public string $feedId = '';
|
|
|
|
|
|
public function __construct() {
|
|
|
$this->addRequiredOption('user', (new CliOption('user')));
|
|
|
+ $this->addOption('feedId', (new CliOption('feed-id')));
|
|
|
parent::__construct();
|
|
|
}
|
|
|
};
|
|
|
@@ -20,6 +22,16 @@ if (!empty($cliOptions->errors)) {
|
|
|
|
|
|
$username = cliInitUser($cliOptions->user);
|
|
|
|
|
|
+$feedId = null;
|
|
|
+if ($cliOptions->feedId !== '') {
|
|
|
+ $feedId = filter_var($cliOptions->feedId, FILTER_VALIDATE_INT, [
|
|
|
+ 'options' => ['min_range' => 1],
|
|
|
+ ]);
|
|
|
+ if (!is_int($feedId)) {
|
|
|
+ fail('FreshRSS error: Invalid feed ID: ' . $cliOptions->feedId . "\n");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
Minz_ExtensionManager::callHookVoid(Minz_HookType::FreshrssUserMaintenance);
|
|
|
|
|
|
fwrite(STDERR, 'FreshRSS actualizing user “' . $username . "”…\n");
|
|
|
@@ -42,7 +54,7 @@ if (!empty($result['successes'])) {
|
|
|
echo "FreshRSS refreshed $successes dynamic OPMLs for $username\n";
|
|
|
}
|
|
|
|
|
|
-[$nbUpdatedFeeds, , $nbNewArticles] = FreshRSS_feed_Controller::actualizeFeedsAndCommit();
|
|
|
+[$nbUpdatedFeeds, , $nbNewArticles] = FreshRSS_feed_Controller::actualizeFeedsAndCommit($feedId);
|
|
|
|
|
|
echo "FreshRSS actualized $nbUpdatedFeeds feeds for $username ($nbNewArticles new articles)\n";
|
|
|
|