]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix ccache_update() failure when called for labels
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Jan 2009 17:23:12 +0000 (18:23 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Jan 2009 17:23:12 +0000 (18:23 +0100)
backend.php
functions.php

index 5d25ba30279ff9010499cf01af70490be411ea79..1e60e392d0445f5826e22b206c7c907b122438da 100644 (file)
                        $csync = $_GET["csync"];
                        $order_by = db_escape_string($_GET["order_by"]);
 
-                       ccache_update($link, $feed, $_SESSION["uid"], $cat_view);
+                       /* Updating a label ccache means recalculating all of the caches
+                        * so for performance reasons we don't do that here */
+
+                       if ($feed >= 0) {
+                               ccache_update($link, $feed, $_SESSION["uid"], $cat_view);
+                       }
 
                        set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode);
                        set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit);
index 673b0b26e23564e11ae425d75eb67cd0cfd614c9..c738ebe65bd8c7a8ad924c79c0b63ce629ee68ea 100644 (file)
 
                        ccache_update($link, 0, $owner_uid, true);
 
-
                } else {
                        $result = db_query($link, "SELECT feed_id FROM ttrss_counters_cache
                                WHERE feed_id > 0 AND owner_uid = '$owner_uid'");
                                WHERE id = feed_id AND $cat_qpart AND 
                                ttrss_feeds.owner_uid = '$owner_uid'");
 
-                       $unread = db_fetch_result($result, 0, "sv");
+                       $unread = (int) db_fetch_result($result, 0, "sv");
 
                } else {
                        $unread = (int) getFeedArticles($link, $feed_id, $is_cat, true, $owner_uid);
                                (feed_id, value, owner_uid, updated) 
                                VALUES 
                                ($feed_id, $unread, $owner_uid, NOW())");
-                               
                }
 
                if ($feed_id > 0 && $prev_unread != $unread) {