]> git.wh0rd.org Git - tt-rss.git/commitdiff
update_rss_feed: minor code cleanup
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 27 Apr 2017 10:08:43 +0000 (13:08 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Thu, 27 Apr 2017 10:08:43 +0000 (13:08 +0300)
include/rssfuncs.php

index ff46ac8a1c4debff2c1e68d11a302c56532e56c3..4fdd2843fbcda78c3c9d379299c8beb10188fae1 100644 (file)
                        $feed_data = $plugin->hook_feed_fetched($feed_data, $fetch_url, $owner_uid, $feed);
                }
 
-               // set last update to now so if anything *simplepie* crashes later we won't be
-               // continuously failing on the same feed
-               //db_query("UPDATE ttrss_feeds SET last_updated = NOW() WHERE id = '$feed'");
-
-               if (!$rss) {
-                       $rss = new FeedParser($feed_data);
-                       $rss->init();
-               }
-
-//             print_r($rss);
+               $rss = new FeedParser($feed_data);
+               $rss->init();
 
                $feed = db_escape_string($feed);
 
 
                                if (db_num_rows($result) == 0) {
 
-                                       _debug("base guid [$entry_guid] not found", $debug_enabled);
+                                       _debug("base guid [$entry_guid or $entry_guid_hashed] not found, creating...", $debug_enabled);
 
                                        // base post entry does not exist, create it
 
-                                       $result = db_query(
+                                       db_query(
                                                "INSERT INTO ttrss_entries
                                                        (title,
                                                        guid,
                                                        '$entry_language',
                                                        '$entry_author')");
 
-                               } else {
-                                       $base_entry_id = db_fetch_result($result, 0, "id");
                                }
 
                                // now it should exist, if not - bad luck then