removed unused urlHash field

This commit is contained in:
Athou
2013-07-27 15:45:15 +02:00
parent 3dd4f140e2
commit 60bf96411c
4 changed files with 8 additions and 19 deletions

View File

@@ -72,15 +72,10 @@ public class FeedDAO extends GenericDAO<Feed> {
}
public Feed findByUrl(String url) {
List<Feed> feeds = findByField(Feed_.urlHash, DigestUtils.sha1Hex(url));
Feed feed = Iterables.getFirst(feeds, null);
if (feed != null && StringUtils.equals(url, feed.getUrl())) {
return feed;
}
String normalized = FeedUtils.normalizeURL(url);
feeds = findByField(Feed_.normalizedUrlHash, DigestUtils.sha1Hex(normalized));
feed = Iterables.getFirst(feeds, null);
List<Feed> feeds = findByField(Feed_.normalizedUrlHash, DigestUtils.sha1Hex(normalized));
Feed feed = Iterables.getFirst(feeds, null);
if (feed != null && StringUtils.equals(normalized, feed.getNormalizedUrl())) {
return feed;
}