optimize surftip data load,

double load (index, loader) not neccessary, getMetadata already suficient
+ lng file adjustments
pull/51/head
reger 9 years ago
parent 5f113be760
commit 8c9684cc45

@ -556,31 +556,18 @@ public class yacysearch {
}
final String recommendHash = post.get("recommendref", ""); // urlhash
final URIMetadataNode urlentry = indexSegment.fulltext().getMetadata(UTF8.getBytes(recommendHash));
if ( urlentry != null ) {
Document[] documents = null;
try {
documents =
sb.loader.loadDocuments(
sb.loader.request(urlentry.url(), true, false),
CacheStrategy.IFEXIST,
Integer.MAX_VALUE, BlacklistType.SEARCH, ClientIdentification.yacyIntranetCrawlerAgent);
} catch (final IOException e ) {
} catch (final Parser.Failure e ) {
}
if ( documents != null ) {
// create a news message
final Map<String, String> map = new HashMap<String, String>();
map.put("url", urlentry.url().toNormalform(true).replace(',', '|'));
map.put("title", urlentry.dc_title().replace(',', ' '));
map.put("description", documents[0].dc_title().replace(',', ' '));
map.put("author", documents[0].dc_creator());
map.put("tags", documents[0].dc_subject(' '));
sb.peers.newsPool.publishMyNews(
if (urlentry != null) {
// create a news message
final Map<String, String> map = new HashMap<String, String>();
map.put("url", urlentry.url().toNormalform(true).replace(',', '|'));
map.put("title", urlentry.dc_title().replace(',', ' '));
map.put("description", urlentry.getDescription().isEmpty() ? urlentry.dc_title().replace(',', ' ') : urlentry.getDescription().get(0).replace(',', ' '));
map.put("author", urlentry.dc_creator());
map.put("tags", urlentry.dc_subject().replace(',', ' '));
sb.peers.newsPool.publishMyNews(
sb.peers.mySeed(),
NewsPool.CATEGORY_SURFTIPP_ADD,
map);
documents[0].close();
}
}
}

@ -3893,6 +3893,7 @@ Content Control==Inhaltskontrolle
>Published&nbsp;News<==>Veröffentlichte&nbsp;Nachrichten<
## Community Data Submenu
>Community Data<==>Gemeinschaftsdaten<
>Surftips<==>Surftipps<
>Local Peer Wiki<==>Lokales Peer Wiki<
#-----------------------------

@ -2226,7 +2226,7 @@ Processed&nbsp;News==Nouvelles&nbsp;trait&eacute;es
Outgoing&nbsp;News==Nouvelles&nbsp;sortantes
Published&nbsp;News==Nouvelles&nbsp;publi&eacute;es
Community Data==Donn&eacute;es communes
Surftips==Astuces de navigation
>Surftips<==>Astuces de navigation<
Local Peer Wiki==Wiki du noeud local
#---------------------------

Loading…
Cancel
Save