projects
/
pnews.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
navigation with hot topics
[pnews.git]
/
war
/
src
/
main
/
java
/
pnews
/
servlet
/
ArticleProvider.java
diff --git
a/war/src/main/java/pnews/servlet/ArticleProvider.java
b/war/src/main/java/pnews/servlet/ArticleProvider.java
index
5efea15
..
c2d8f59
100644
(file)
--- a/
war/src/main/java/pnews/servlet/ArticleProvider.java
+++ b/
war/src/main/java/pnews/servlet/ArticleProvider.java
@@
-90,11
+90,7
@@
public class ArticleProvider {
thumbnail = e.getUrl();
break;
}
thumbnail = e.getUrl();
break;
}
-
- if (thumbnail == null && feed.getImage() != null)
- thumbnail = feed.getImage().getUrl();
-
-
+
title = entry.getTitle().trim();
if (entry.getDescription() != null) {
title = entry.getTitle().trim();
if (entry.getDescription() != null) {
@@
-185,16
+181,24
@@
public class ArticleProvider {
/**
* Returns a copy.
*/
/**
* Returns a copy.
*/
- public List<Article> getArticles(Category cat)
+ public List<Article> getArticles(Category cat
, String entity
)
throws IllegalArgumentException, MalformedURLException, FeedException, IOException {
throws IllegalArgumentException, MalformedURLException, FeedException, IOException {
- List<Article> articles
;
+ List<Article> articles
, result;
synchronized (articlesByCategory) {
articles = getArticlesForUpdate(cat);
}
synchronized (articlesByCategory) {
articles = getArticlesForUpdate(cat);
}
- synchronized (articles) {
- return new ArrayList<>(articles);
+ synchronized (articles) {
+ if (entity == null)
+ return new ArrayList<>(articles);
+
+ result = new ArrayList<>(articles.size());
+ for (Article a: articles)
+ if (a.hasEntity(entity))
+ result.add(a);
+
+ return result;
}
}
}
}
@@
-207,7
+211,7
@@
public class ArticleProvider {
LOG.entering(CLASS_NAME, FUNCTION_NAME, cat);
LOG.entering(CLASS_NAME, FUNCTION_NAME, cat);
- articles = getArticles(cat);
+ articles = getArticles(cat
, null
);
entities = new HashMap<>();
for (Article a: articles)
entities = new HashMap<>();
for (Article a: articles)