]> git.wh0rd.org - tt-rss.git/commitdiff
fix expiry-generated dupes (see changeset)
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 29 Dec 2005 15:09:51 +0000 (16:09 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 29 Dec 2005 15:09:51 +0000 (16:09 +0100)
functions.php

index 26fcbbdcd5c1ef78e61cd594d36463ad481a09e6..c67a7a99b985d38e28f6d05650f425d019db1d03 100644 (file)
                                                        NOW(), 
                                                        '$entry_comments',
                                                        '$num_comments')");
+                               } else {
+                                       // we keep encountering the entry in feeds, so we need to
+                                       // update date_entered column so that we don't get horrible
+                                       // dupes when the entry gets purged and reinserted again e.g.
+                                       // in the case of SLOW SLOW OMG SLOW updating feeds
+
+                                       $base_entry_id = db_fetch_result($result, 0, "id");
+
+                                       db_query($link, "UPDATE ttrss_entries SET date_entered = NOW()
+                                               WHERE id = '$base_entry_id'");
                                }
 
                                // now it should exist, if not - bad luck then
 
                                $result = db_query($link, "SELECT 
                                                id,content_hash,no_orig_date,title,
+                                               substring(date_entered,1,19) as date_entered,
                                                substring(updated,1,19) as updated,
                                                num_comments
                                        FROM 
                                        $orig_content_hash = db_fetch_result($result, 0, "content_hash");
                                        $orig_title = db_fetch_result($result, 0, "title");
                                        $orig_num_comments = db_fetch_result($result, 0, "num_comments");
+                                       $orig_date_entered = strtotime(db_fetch_result($result, 
+                                               0, "date_entered"));
 
                                        $ref_id = db_fetch_result($result, 0, "id");