]> git.wh0rd.org Git - tt-rss.git/commitdiff
experimental: if using adaptive/unread mode w/ auto catchup don't calculate offsets...
authorAndrew Dolgov <noreply@fakecake.org>
Wed, 5 Aug 2015 07:13:30 +0000 (10:13 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Wed, 5 Aug 2015 07:13:30 +0000 (10:13 +0300)
classes/api.php
include/functions2.php

index 08c1846d2ad8353b9e8f16282fa6d62229cdeeea..2d420e5278095846a2cbb1ace2759a2430bc6695 100644 (file)
@@ -686,7 +686,8 @@ class API extends Handler {
                                "offset" => $offset,
                                "since_id" => $since_id,
                                "include_children" => $include_nested,
-                               "check_first_id" => $check_first_id
+                               "check_first_id" => $check_first_id,
+                               "api_request" => true
                        );
 
                        $qfh_ret = queryFeedHeadlines($params);
index 1898aa2eac995044262222061b872d8e960a42d0..996e99f422f04c87fe2aaad38e9e58f829b69875 100644 (file)
                $override_vfeed = isset($params["override_vfeed"]) ? $params["override_vfeed"] : false;
                $start_ts = isset($params["start_ts"]) ? $params["start_ts"] : false;
                $check_first_id = isset($params["check_first_id"]) ? $params["check_first_id"] : false;
+               $api_request = isset($params["api_request"]) ? $params["api_request"] : false;
 
                $ext_tables_part = "";
                $query_strategy_part = "";
                        }
 
                        $view_query_part = "";
+                       $disable_offsets = false;
 
                        if ($view_mode == "adaptive") {
                                if ($search) {
                                        if ($cat_view && $feed > 0 && $include_children)
                                                $unread += getCategoryChildrenUnread($feed);
 
-                                       if ($unread > 0)
-                               $view_query_part = " unread = true AND ";
-
+                                       if ($unread > 0) {
+                                               $view_query_part = " unread = true AND ";
+                                               $disable_offsets = !$api_request && get_pref("CDM_AUTO_CATCHUP");
+                                       }
                                }
                        }
 
 
                        if ($view_mode == "unread" && $feed != -6) {
                                $view_query_part = " unread = true AND ";
+                               $disable_offsets = !$api_request && get_pref("CDM_AUTO_CATCHUP");
                        }
 
                        if ($limit > 0) {
                                        }
                                }
 
+                               if ($disable_offsets) {
+                                       $offset_query_part = "";
+                               }
+
                                $query = "SELECT DISTINCT
                                                date_entered,
                                                guid,