]> git.wh0rd.org Git - tt-rss.git/commitdiff
headline caching fixes
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 Nov 2007 09:05:04 +0000 (10:05 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 Nov 2007 09:05:04 +0000 (10:05 +0100)
backend.php
feedlist.js
functions.php
viewfeed.js

index 826a1ed92fd41fec1e09d7b7712688c53aabfda2..02b52e68aadf66f9599aab38442b911825dd8b9e 100644 (file)
 
                $topmost_article_ids = $ret[0];
                $headlines_count = $ret[1];
+               $returned_feed = $ret[2];
 
                print "]]></headlines>";
 
                print "<headlines-count value=\"$headlines_count\"/>";
 
-               $headlines_unread = getFeedUnread($link, $feed);
+               $headlines_unread = getFeedUnread($link, $returned_feed);
 
                print "<headlines-unread value=\"$headlines_unread\"/>";
 
index 69aee9d1c3aa2e00914ff1ce933f4cb3f24152c9..acb46e9395a5ce0e64c068078c8cbd92f0715926 100644 (file)
@@ -171,7 +171,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
                                } 
                        }
 
-                       f.innerHTML = cache_find("F:" + feed);
+                       f.innerHTML = cache_find_param("F:" + feed, unread_ctr);
 
                        var query = "backend.php?op=rpc&subop=getAllCounters";
 
index 8e81b3cce09254d72eaefbb07da13c4dda8d5b53..0ff53352595f0987b6d3387ff39b09d9adb3a1ec 100644 (file)
                        print "</div>";
                }
 
-               return array($topmost_article_ids, $headlines_count);
+               return array($topmost_article_ids, $headlines_count, $feed);
        }
 
 // from here: http://www.roscripts.com/Create_tag_cloud-71.html
index 492f1f0927459559b6b5f0c126eb8a4f42d695e1..1688680fcf26a32b6390049ffcbe2e31a8c23e9f 100644 (file)
@@ -1196,7 +1196,7 @@ function cdmWatchdog() {
 
 
 function cache_inject(id, article, param) {
-       if (!cache_check(id, param)) {
+       if (!cache_check_param(id, param)) {
                debug("cache_article: miss: " + id + " [p=" + param + "]");
 
                var cache_obj = new Array();
@@ -1221,10 +1221,10 @@ function cache_find(id) {
        return false;
 }
 
-function cache_get_param(id) {
+function cache_find_param(id, param) {
        for (var i = 0; i < article_cache.length; i++) {
-               if (article_cache[i]["id"] == id) {
-                       return article_cache[i]["param"];
+               if (article_cache[i]["id"] == id && article_cache[i]["param"] == param) {
+                       return article_cache[i]["data"];
                }
        }
        return false;
@@ -1241,6 +1241,10 @@ function cache_check(id) {
 
 function cache_check_param(id, param) {
        for (var i = 0; i < article_cache.length; i++) {
+
+//             debug("cache_check_param " + article_cache[i]["id"] + ":" + 
+//                     article_cache[i]["param"] + " vs " + id + ":" + param);
+
                if (article_cache[i]["id"] == id && article_cache[i]["param"] == param) {
                        return true;
                }