mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-19 12:58:29 +00:00
Fix updates to saved stories count.
This commit is contained in:
parent
ee2ac2d070
commit
a93cb5079b
2 changed files with 6 additions and 1 deletions
|
@ -573,6 +573,11 @@ public class FeedProvider extends ContentProvider {
|
|||
case SOCIALFEED_COUNT:
|
||||
db.execSQL("UPDATE " + DatabaseConstants.SOCIALFEED_TABLE + " SET " + selectionArgs[0] + " = " + selectionArgs[0] + " - 1 WHERE " + DatabaseConstants.SOCIAL_FEED_ID + " = " + selectionArgs[1]);
|
||||
return 0;
|
||||
case STARRED_STORIES_COUNT:
|
||||
int rows = db.update(DatabaseConstants.STARRED_STORY_COUNT_TABLE, values, null, null);
|
||||
if (rows == 0 ) {
|
||||
db.insertWithOnConflict(DatabaseConstants.STARRED_STORY_COUNT_TABLE, null, values, SQLiteDatabase.CONFLICT_REPLACE);
|
||||
}
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unknown URI: " + uri);
|
||||
}
|
||||
|
|
|
@ -550,7 +550,7 @@ public class APIManager {
|
|||
int starredStoriesCount = feedUpdate.starredCount;
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(DatabaseConstants.STARRED_STORY_COUNT_COUNT, starredStoriesCount);
|
||||
contentResolver.insert(FeedProvider.STARRED_STORIES_COUNT_URI, values);
|
||||
contentResolver.update(FeedProvider.STARRED_STORIES_COUNT_URI, values, null, null);
|
||||
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue