summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-08-05 10:13:30 +0300
committerAndrew Dolgov <[email protected]>2015-08-05 10:13:30 +0300
commit0bd172cd6a6f8ddad4aea1b18fe6d2b1e27f8690 (patch)
treeda271d8aee3222ea8918547572ab4fa93be61a74 /include
parent332ff5cfb8e52bb9a9f12a0d535c0f0c5e30397a (diff)
experimental: if using adaptive/unread mode w/ auto catchup don't calculate offsets because we're only interested in top $limit headlines anyway
Diffstat (limited to 'include')
-rw-r--r--include/functions2.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/functions2.php b/include/functions2.php
index 1898aa2ea..996e99f42 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -463,6 +463,7 @@
$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 = "";
@@ -491,6 +492,7 @@
}
$view_query_part = "";
+ $disable_offsets = false;
if ($view_mode == "adaptive") {
if ($search) {
@@ -502,9 +504,10 @@
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");
+ }
}
}
@@ -522,6 +525,7 @@
if ($view_mode == "unread" && $feed != -6) {
$view_query_part = " unread = true AND ";
+ $disable_offsets = !$api_request && get_pref("CDM_AUTO_CATCHUP");
}
if ($limit > 0) {
@@ -762,6 +766,10 @@
}
}
+ if ($disable_offsets) {
+ $offset_query_part = "";
+ }
+
$query = "SELECT DISTINCT
date_entered,
guid,