From 200769d0c61313f5598d260bdd1034ba881a6d89 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 9 Jun 2013 08:15:23 +0200 Subject: [PATCH] show the cache link in search results only if there is actually a cache entry stored in HTCACHE --- htroot/yacysearchitem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.java index e769a7225..d0bd59d2f 100644 --- a/htroot/yacysearchitem.java +++ b/htroot/yacysearchitem.java @@ -37,6 +37,7 @@ import net.yacy.cora.protocol.Domains; import net.yacy.cora.protocol.HeaderFramework; import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader.FileType; +import net.yacy.crawler.data.Cache; import net.yacy.data.URLLicense; import net.yacy.kelondro.data.meta.DigestURI; import net.yacy.kelondro.logging.Log; @@ -133,7 +134,7 @@ public class yacysearchitem { prop.put("content_showMetadata", sb.getConfigBool("search.result.show.metadata", true) ? 1 : 0); prop.put("content_showParser", sb.getConfigBool("search.result.show.parser", true) ? 1 : 0); prop.put("content_showPictures", sb.getConfigBool("search.result.show.pictures", true) ? 1 : 0); - prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) ? 1 : 0); + prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) && Cache.has(resultURL.hash()) ? 1 : 0); prop.put("content_showProxy", sb.getConfigBool("search.result.show.proxy", true) ? 1 : 0); prop.put("content_showHostBrowser", sb.getConfigBool("search.result.show.hostbrowser", true) ? 1 : 0); prop.put("content_showTags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);