]> git.wh0rd.org Git - tt-rss.git/commitdiff
update amount of subscribed feeds in runtime-info (to invalidate feedlist cache)
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 2 Feb 2009 12:24:32 +0000 (15:24 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 2 Feb 2009 12:24:32 +0000 (15:24 +0300)
feedlist.js
functions.php
tt-rss.js

index e148337c7b58cbbe16c69bb626f6324055a558a1..47542e5441153c9e7c676663fdf3f9d3bc4745ba 100644 (file)
@@ -36,7 +36,7 @@ function render_feedlist(data) {
                var f = document.getElementById("feeds-frame");
                f.innerHTML = data;
                cache_invalidate("FEEDLIST");
-               cache_inject("FEEDLIST", data);
+               cache_inject("FEEDLIST", data, getInitParam("num_feeds"));
                feedlist_init();
 
        } catch (e) {
index 523c74944d14a465f8694b5dbfb44ded42fa60b9..80488b09f9b7d3c1294a2f73f457848c4b0f9421 100644 (file)
 
                print "<param key=\"sync_counters\" value=\"1\"/>";
 
+               $result = db_query($link, "SELECT COUNT(*) AS cf FROM
+                       ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
+
+               $num_feeds = db_fetch_result($result, 0, "cf");
+
+               print "<param key=\"num_feeds\" value=\"".
+                       (int)$num_feeds. "\"/>";
+
                print "</init-params>";
        }
 
        function print_runtime_info($link) {
                print "<runtime-info>";
 
+               $result = db_query($link, "SELECT COUNT(*) AS cf FROM
+                       ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
+
+               $num_feeds = db_fetch_result($result, 0, "cf");
+
+               print "<param key=\"num_feeds\" value=\"".
+                       (int)$num_feeds. "\"/>";
+
                if (ENABLE_UPDATE_DAEMON) {
                        print "<param key=\"daemon_is_running\" value=\"".
                                sprintf("%d", file_is_locked("update_daemon.lock")) . "\"/>";
index c3c21cc20cf1140041fd5b6caee83a4f4ce7091e..da88d3d69ce991459d17ae60862f89782ae84a1e 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -510,7 +510,7 @@ function init_second_stage() {
                daemon_refresh_only = getInitParam("daemon_refresh_only") == 1;
                feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
 
-               var fl = cache_find("FEEDLIST");
+               var fl = cache_find_param("FEEDLIST", getInitParam("num_feeds"));
 
                if (fl) {
                        render_feedlist(fl);
@@ -737,6 +737,10 @@ function parse_runtime_info(elem) {
 
                debug("RI: " + k + " => " + v);
 
+               if (k == "num_feeds") {
+                       init_params[k] = v;                                     
+               }
+
                if (k == "new_version_available") {
                        var icon = document.getElementById("newVersionIcon");
                        if (icon) {