mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Only clean up read stories.
This commit is contained in:
parent
fec57f7519
commit
55c08f10af
2 changed files with 4 additions and 3 deletions
|
@ -56,9 +56,10 @@ public class BlurDatabaseHelper {
|
|||
String q = "DELETE FROM " + DatabaseConstants.STORY_TABLE +
|
||||
" WHERE " + DatabaseConstants.STORY_ID + " IN " +
|
||||
"( SELECT " + DatabaseConstants.STORY_ID + " FROM " + DatabaseConstants.STORY_TABLE +
|
||||
" WHERE " + DatabaseConstants.STORY_FEED_ID + " = " + feedId +
|
||||
" WHERE " + DatabaseConstants.STORY_READ + " = 1" +
|
||||
" AND " + DatabaseConstants.STORY_FEED_ID + " = " + feedId +
|
||||
" ORDER BY " + DatabaseConstants.STORY_TIMESTAMP + " DESC" +
|
||||
" LIMIT -1 OFFSET " + AppConstants.MAX_STORIES_STORED +
|
||||
" LIMIT -1 OFFSET " + AppConstants.MAX_READ_STORIES_STORED +
|
||||
")";
|
||||
dbRW.execSQL(q);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class AppConstants {
|
|||
public static final int READING_STORY_PRELOAD = 5;
|
||||
|
||||
// max old stories to keep in the DB per feed before fetching new unreads
|
||||
public static final int MAX_STORIES_STORED = 500;
|
||||
public static final int MAX_READ_STORIES_STORED = 10;
|
||||
|
||||
// how many unread stories to fetch via hash at a time
|
||||
public static final int UNREAD_FETCH_BATCH_SIZE = 20;
|
||||
|
|
Loading…
Add table
Reference in a new issue