From dab229cd1f8ac90203f82f4be9b4407c53110743 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Aug 2015 12:17:49 +0300 Subject: [PATCH 1/6] update_rss_feed: disable transactions for the time being --- include/rssfuncs.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/rssfuncs.php b/include/rssfuncs.php index c8e2ce28f..6532fb270 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -796,7 +796,7 @@ $entry_content = db_escape_string($entry_content, false); - db_query("BEGIN"); + //db_query("BEGIN"); $result = db_query("SELECT id FROM ttrss_entries WHERE (guid = '$entry_guid' OR guid = '$entry_guid_hashed')"); @@ -889,7 +889,7 @@ } if (find_article_filter($article_filters, "filter")) { - db_query("COMMIT"); // close transaction in progress + //db_query("COMMIT"); // close transaction in progress continue; } @@ -1020,7 +1020,7 @@ } } - db_query("COMMIT"); + //db_query("COMMIT"); _debug("assigning labels [other]...", $debug_enabled); @@ -1054,7 +1054,7 @@ print_r($enclosures); } - db_query("BEGIN"); + //db_query("BEGIN"); // debugging // db_query("DELETE FROM ttrss_enclosures WHERE post_id = '$entry_ref_id'"); @@ -1077,7 +1077,7 @@ } } - db_query("COMMIT"); + //db_query("COMMIT"); // check for manual tags (we have to do it here since they're loaded from filters) @@ -1121,7 +1121,7 @@ if (count($filtered_tags) > 0) { - db_query("BEGIN"); + //db_query("BEGIN"); foreach ($filtered_tags as $tag) { @@ -1154,7 +1154,7 @@ SET tag_cache = '$tags_str' WHERE ref_id = '$entry_ref_id' AND owner_uid = $owner_uid"); - db_query("COMMIT"); + //db_query("COMMIT"); } _debug("article processed", $debug_enabled); From e07be79a8ba398e0dbc299265e5e9cb5d0b0d674 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Aug 2015 12:20:01 +0300 Subject: [PATCH 2/6] first id query: add last_read for recently read feed --- include/functions2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/functions2.php b/include/functions2.php index 418dbc95b..59f6caa88 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -739,7 +739,8 @@ marked, published, last_marked, - last_published + last_published, + last_read FROM $from_qpart WHERE From 14ce0e25043dfa70d87985a1d4fa06c1d3d1c8b4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Aug 2015 12:29:27 +0300 Subject: [PATCH 3/6] update: reenable first ref_id/id transaction --- include/rssfuncs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 6532fb270..14e280f9f 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -796,7 +796,7 @@ $entry_content = db_escape_string($entry_content, false); - //db_query("BEGIN"); + db_query("BEGIN"); $result = db_query("SELECT id FROM ttrss_entries WHERE (guid = '$entry_guid' OR guid = '$entry_guid_hashed')"); @@ -889,7 +889,7 @@ } if (find_article_filter($article_filters, "filter")) { - //db_query("COMMIT"); // close transaction in progress + db_query("COMMIT"); // close transaction in progress continue; } @@ -1020,7 +1020,7 @@ } } - //db_query("COMMIT"); + db_query("COMMIT"); _debug("assigning labels [other]...", $debug_enabled); From 07877caf40c8c46fe6f962b9cb1f0089e58001cc Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Aug 2015 13:15:37 +0300 Subject: [PATCH 4/6] Revert "update: reenable first ref_id/id transaction" This reverts commit 14ce0e25043dfa70d87985a1d4fa06c1d3d1c8b4. --- include/rssfuncs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 14e280f9f..6532fb270 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -796,7 +796,7 @@ $entry_content = db_escape_string($entry_content, false); - db_query("BEGIN"); + //db_query("BEGIN"); $result = db_query("SELECT id FROM ttrss_entries WHERE (guid = '$entry_guid' OR guid = '$entry_guid_hashed')"); @@ -889,7 +889,7 @@ } if (find_article_filter($article_filters, "filter")) { - db_query("COMMIT"); // close transaction in progress + //db_query("COMMIT"); // close transaction in progress continue; } @@ -1020,7 +1020,7 @@ } } - db_query("COMMIT"); + //db_query("COMMIT"); _debug("assigning labels [other]...", $debug_enabled); From 91837f0a2a5ed23ed5ef5f936374c7494d3f71a1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Aug 2015 15:14:38 +0300 Subject: [PATCH 5/6] update site_url (and title if needed) when changing feed_url in feed editor --- classes/pref/feeds.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 01197d92c..96a234af0 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -991,6 +991,11 @@ class Pref_Feeds extends Handler_Protected { if (!$batch) { + $result = db_query("SELECT feed_url FROM ttrss_feeds WHERE id = " . $feed_id); + $orig_feed_url = db_fetch_result($result, 0, "feed_url"); + + $reset_basic_info = $orig_feed_url != $feed_link; + $this->dbh->query("UPDATE ttrss_feeds SET $category_qpart title = '$feed_title', feed_url = '$feed_link', @@ -1008,6 +1013,12 @@ class Pref_Feeds extends Handler_Protected { feed_language = '$feed_language' WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]); + if ($reset_basic_info) { + require_once "rssfuncs.php"; + + set_basic_feed_info($feed_id); + } + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_SAVE_FEED, "hook_prefs_save_feed", $feed_id); From 1f6732b245c9ea77bca9415653d2c993a02c8ca4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 10 Aug 2015 22:29:09 +0300 Subject: [PATCH 6/6] af_redditimgur: fix for gfycat --- plugins/af_redditimgur/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index f3d8b28b4..e7658120d 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -95,7 +95,7 @@ class Af_RedditImgur extends Plugin { if ($tmpdoc) { $tmpxpath = new DOMXPath($tmpdoc); - $source_meta = $tmpxpath->query("//meta[@property='og:video']")->item(0); + $source_meta = $tmpxpath->query("//meta[@name='twitter:player:stream' and contains(@content, '.mp4')]")->item(0); $poster_meta = $tmpxpath->query("//meta[@property='og:image' and contains(@content,'thumbs.gfycat.com')]")->item(0); if ($source_meta) {