do not try to update filter triggers if nothing was triggered (properly this time)

This commit is contained in:
Andrew Dolgov 2018-12-06 23:12:20 +03:00
parent 5780a5d501
commit 1e3a53c037
1 changed files with 6 additions and 4 deletions

View File

@ -781,13 +781,15 @@ class RSSUtils {
$plugin->hook_filter_triggered($feed, $owner_uid, $article, $matched_filters, $matched_rules, $article_filters);
}
$matched_filter_ids = implode(",", array_map(function($f) { return $f['id']; }, $matched_filters));
$matched_filter_ids = array_map(function($f) { return $f['id']; }, $matched_filters);
if (count($matched_filter_ids) > 0) {
$filter_ids_qmarks = arr_qmarks($matched_filter_ids);
if ($matched_filter_ids) {
$fsth = $pdo->prepare("UPDATE ttrss_filters2 SET last_triggered = NOW() WHERE
id IN (?) AND owner_uid = ?");
$fsth->execute([$matched_filter_ids, $owner_uid]);
id IN ($filter_ids_qmarks) AND owner_uid = ?");
$fsth->execute(array_merge($matched_filter_ids, [$owner_uid]));
}
if (Debug::get_loglevel() >= Debug::$LOG_EXTENDED) {