Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Commit

Permalink
fetch only new on first run
Browse files Browse the repository at this point in the history
  • Loading branch information
Bademus committed Apr 27, 2014
1 parent 65e8178 commit 90e582e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@ protected void fetchEntries(final ContentResolver contentResolver, final String
Cursor cursor = contentResolver.query(Entries.CONTENT_URI,
new String[]{"MAX(" + Entries.CRAWLED + ")"},
null, null, null, null);
if (cursor.moveToFirst()) { //fetch latest
if (cursor.moveToFirst()) { // fetch latest
request.setNewerThan(cursor.getLong(1) + 1);
} else { // first run
request.setUnreadOnly(Boolean.TRUE);
}
cursor.close();

Expand All @@ -140,8 +142,6 @@ protected void fetchEntries(final ContentResolver contentResolver, final String
private Collection<Entry> execute(final Feedly.Streams.Contents request) {
final Collection<Entry> entriesCache = new ArrayList<Entry>();
do {
//TODO: for dev purposes
if (entriesCache.size() > 20) { break; }

try {
EntriesResponse result = request.execute();
Expand Down

0 comments on commit 90e582e

Please sign in to comment.