update_rss_feed: set basic feed info if site_url is blank

This commit is contained in:
Andrew Dolgov 2019-03-15 14:00:09 +03:00
parent 4438f27f73
commit 33a2d5f8e4
1 changed files with 4 additions and 3 deletions

View File

@ -263,7 +263,7 @@ class RSSUtils {
$pdo = Db::pdo(); $pdo = Db::pdo();
$sth = $pdo->prepare("SELECT title FROM ttrss_feeds WHERE id = ?"); $sth = $pdo->prepare("SELECT title, site_url FROM ttrss_feeds WHERE id = ?");
$sth->execute([$feed]); $sth->execute([$feed]);
if (!$row = $sth->fetch()) { if (!$row = $sth->fetch()) {
@ -273,11 +273,12 @@ class RSSUtils {
} }
$title = $row["title"]; $title = $row["title"];
$site_url = $row["site_url"];
// feed was batch-subscribed or something, we need to get basic info // feed was batch-subscribed or something, we need to get basic info
// this is not optimal currently as it fetches stuff separately TODO: optimize // this is not optimal currently as it fetches stuff separately TODO: optimize
if ($title == "[Unknown]") { if ($title == "[Unknown]" || !$title || !$site_url) {
Debug::log("setting basic feed info for $feed..."); Debug::log("setting basic feed info for $feed [$title, $site_url]...");
RSSUtils::set_basic_feed_info($feed); RSSUtils::set_basic_feed_info($feed);
} }