From 2fa54cc627cd9a370004a48e1b6430a8a9990846 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sun, 18 May 2025 14:26:05 +0000 Subject: Deprecate and remove use of the 'SUBSTRING_FOR_DATE' constant. With MySQL support removed (b154bc7a10e46dc9fa0406996507c4fd410366da) this constant is unnecessary. --- classes/RSSUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/RSSUtils.php') diff --git a/classes/RSSUtils.php b/classes/RSSUtils.php index 9403cebdd..017deaf8b 100644 --- a/classes/RSSUtils.php +++ b/classes/RSSUtils.php @@ -345,7 +345,7 @@ class RSSUtils { $feed_obj = ORM::for_table('ttrss_feeds') ->select_expr("ttrss_feeds.*, - ".SUBSTRING_FOR_DATE."(last_unconditional, 1, 19) AS last_unconditional, + SUBSTRING_FOR_DATE(last_unconditional, 1, 19) AS last_unconditional, (favicon_is_custom IS NOT TRUE AND (favicon_last_checked IS NULL OR favicon_last_checked < NOW() - INTERVAL '12 hour')) AS favicon_needs_check") ->find_one($feed); -- cgit v1.2.3-54-g00ecf From 2749c75b727944bed7f19a81687cc8ac3e5e7cd4 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sun, 18 May 2025 16:06:44 +0000 Subject: Minor ORM usage tweak in 'RSSUtils::update_rss_feed()'. --- classes/RSSUtils.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'classes/RSSUtils.php') diff --git a/classes/RSSUtils.php b/classes/RSSUtils.php index 017deaf8b..da5862c56 100644 --- a/classes/RSSUtils.php +++ b/classes/RSSUtils.php @@ -344,11 +344,13 @@ class RSSUtils { $cache = DiskCache::instance('feeds'); $feed_obj = ORM::for_table('ttrss_feeds') - ->select_expr("ttrss_feeds.*, - SUBSTRING_FOR_DATE(last_unconditional, 1, 19) AS last_unconditional, - (favicon_is_custom IS NOT TRUE AND - (favicon_last_checked IS NULL OR favicon_last_checked < NOW() - INTERVAL '12 hour')) AS favicon_needs_check") - ->find_one($feed); + ->select('ttrss_feeds.*') + ->select_many_expr([ + 'last_unconditional' => 'SUBSTRING_FOR_DATE(last_unconditional, 1, 19)', + 'favicon_needs_check' => "(favicon_is_custom IS NOT TRUE AND + (favicon_last_checked IS NULL OR favicon_last_checked < NOW() - INTERVAL '12 hour'))", + ]) + ->find_one($feed); if ($feed_obj) { $feed_obj->last_update_started = Db::NOW(); -- cgit v1.2.3-54-g00ecf From ce36b27a0d01bcc61114028d0f8ec3d3e20d30de Mon Sep 17 00:00:00 2001 From: wn_ Date: Sun, 18 May 2025 16:08:13 +0000 Subject: Fix check for no articles found in 'RSSUtils::update_rss_feed()'. FeedParser will always return an array. --- classes/RSSUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/RSSUtils.php') diff --git a/classes/RSSUtils.php b/classes/RSSUtils.php index da5862c56..d367d91dc 100644 --- a/classes/RSSUtils.php +++ b/classes/RSSUtils.php @@ -679,7 +679,7 @@ class RSSUtils { $items = $rss->get_items(); - if (!is_array($items)) { + if (count($items) === 0) { Debug::log("no articles found.", Debug::LOG_VERBOSE); $feed_obj->set([ -- cgit v1.2.3-54-g00ecf