af_psql_trgm: allow dupe checking within one feed

This commit is contained in:
Andrew Dolgov 2015-01-19 12:56:36 +03:00
parent 117efb6fa4
commit 97600ddd97
1 changed files with 0 additions and 9 deletions

View File

@ -80,9 +80,6 @@ class Af_Psql_Trgm extends Plugin {
print_notice("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking."); print_notice("PostgreSQL trigram extension returns string similarity as a floating point number (0-1). Setting it too low might produce false positives, zero disables checking.");
print "<br/>";
print_notice("Only data in other feeds is checked, i.e. sequential duplicate posts in one feed will not be detected by this plugin.");
print "<br/>"; print "<br/>";
print_notice("Enable the plugin for specific feeds in the feed editor."); print_notice("Enable the plugin for specific feeds in the feed editor.");
@ -112,11 +109,6 @@ class Af_Psql_Trgm extends Plugin {
print "</div>"; print "</div>";
} }
//PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_EDIT_FEED,
// "hook_prefs_edit_feed", $feed_id);
// PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_SAVE_FEED,
// "hook_prefs_save_feed", $feed_id);
function hook_prefs_edit_feed($feed_id) { function hook_prefs_edit_feed($feed_id) {
print "<div class=\"dlgSec\">".__("Similarity (pg_trgm)")."</div>"; print "<div class=\"dlgSec\">".__("Similarity (pg_trgm)")."</div>";
print "<div class=\"dlgSecCont\">"; print "<div class=\"dlgSecCont\">";
@ -179,7 +171,6 @@ class Af_Psql_Trgm extends Plugin {
$result = db_query("SELECT MAX(SIMILARITY(title, '$title_escaped')) AS ms $result = db_query("SELECT MAX(SIMILARITY(title, '$title_escaped')) AS ms
FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id AND FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id AND
date_entered >= NOW() - interval '1 day' AND date_entered >= NOW() - interval '1 day' AND
feed_id != $feed_id AND
owner_uid = $owner_uid"); owner_uid = $owner_uid");
$similarity_result = db_fetch_result($result, 0, "ms"); $similarity_result = db_fetch_result($result, 0, "ms");