mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-21 05:45:13 +00:00
Switch mark-unread task to use story hash.
This commit is contained in:
parent
555e4142a0
commit
ab4c8bea15
4 changed files with 10 additions and 3 deletions
|
@ -83,6 +83,7 @@ public class BlurDatabase extends SQLiteOpenHelper {
|
||||||
")";
|
")";
|
||||||
|
|
||||||
private final String STORY_TABLES_COLS =
|
private final String STORY_TABLES_COLS =
|
||||||
|
DatabaseConstants.STORY_HASH + TEXT + ", " +
|
||||||
DatabaseConstants.STORY_AUTHORS + TEXT + ", " +
|
DatabaseConstants.STORY_AUTHORS + TEXT + ", " +
|
||||||
DatabaseConstants.STORY_CONTENT + TEXT + ", " +
|
DatabaseConstants.STORY_CONTENT + TEXT + ", " +
|
||||||
DatabaseConstants.STORY_DATE + TEXT + ", " +
|
DatabaseConstants.STORY_DATE + TEXT + ", " +
|
||||||
|
|
|
@ -92,6 +92,7 @@ public class DatabaseConstants {
|
||||||
public static final String STORY_SOCIAL_USER_ID = "socialUserId";
|
public static final String STORY_SOCIAL_USER_ID = "socialUserId";
|
||||||
public static final String STORY_SOURCE_USER_ID = "sourceUserId";
|
public static final String STORY_SOURCE_USER_ID = "sourceUserId";
|
||||||
public static final String STORY_TAGS = "tags";
|
public static final String STORY_TAGS = "tags";
|
||||||
|
public static final String STORY_HASH = "story_hash";
|
||||||
|
|
||||||
public static final String COMMENT_ID = BaseColumns._ID;
|
public static final String COMMENT_ID = BaseColumns._ID;
|
||||||
public static final String COMMENT_STORYID = "comment_storyid";
|
public static final String COMMENT_STORYID = "comment_storyid";
|
||||||
|
@ -166,11 +167,11 @@ public class DatabaseConstants {
|
||||||
|
|
||||||
public static final String[] STORY_COLUMNS = {
|
public static final String[] STORY_COLUMNS = {
|
||||||
STORY_AUTHORS, STORY_COMMENT_COUNT, STORY_CONTENT, STORY_DATE, STORY_SHARED_DATE, STORY_SHORTDATE, STORY_LONGDATE, STORY_TABLE + "." + STORY_FEED_ID, STORY_TABLE + "." + STORY_ID, STORY_INTELLIGENCE_AUTHORS, STORY_INTELLIGENCE_FEED, STORY_INTELLIGENCE_TAGS, STORY_INTELLIGENCE_TITLE,
|
STORY_AUTHORS, STORY_COMMENT_COUNT, STORY_CONTENT, STORY_DATE, STORY_SHARED_DATE, STORY_SHORTDATE, STORY_LONGDATE, STORY_TABLE + "." + STORY_FEED_ID, STORY_TABLE + "." + STORY_ID, STORY_INTELLIGENCE_AUTHORS, STORY_INTELLIGENCE_FEED, STORY_INTELLIGENCE_TAGS, STORY_INTELLIGENCE_TITLE,
|
||||||
STORY_PERMALINK, STORY_READ, STORY_SHARE_COUNT, STORY_TAGS, STORY_TITLE, STORY_SOCIAL_USER_ID, STORY_SOURCE_USER_ID, STORY_SHARED_USER_IDS, STORY_FRIEND_USER_IDS, STORY_PUBLIC_USER_IDS, STORY_SUM_TOTAL
|
STORY_PERMALINK, STORY_READ, STORY_SHARE_COUNT, STORY_TAGS, STORY_TITLE, STORY_SOCIAL_USER_ID, STORY_SOURCE_USER_ID, STORY_SHARED_USER_IDS, STORY_FRIEND_USER_IDS, STORY_PUBLIC_USER_IDS, STORY_SUM_TOTAL, STORY_HASH
|
||||||
};
|
};
|
||||||
public static final String[] STARRED_STORY_COLUMNS = {
|
public static final String[] STARRED_STORY_COLUMNS = {
|
||||||
STORY_AUTHORS, STORY_COMMENT_COUNT, STORY_CONTENT, STORY_DATE, STORY_SHARED_DATE, STORY_SHORTDATE, STORY_LONGDATE, STARRED_STORIES_TABLE + "." + STORY_FEED_ID, STARRED_STORIES_TABLE + "." + STORY_ID, STORY_INTELLIGENCE_AUTHORS, STORY_INTELLIGENCE_FEED, STORY_INTELLIGENCE_TAGS, STORY_INTELLIGENCE_TITLE,
|
STORY_AUTHORS, STORY_COMMENT_COUNT, STORY_CONTENT, STORY_DATE, STORY_SHARED_DATE, STORY_SHORTDATE, STORY_LONGDATE, STARRED_STORIES_TABLE + "." + STORY_FEED_ID, STARRED_STORIES_TABLE + "." + STORY_ID, STORY_INTELLIGENCE_AUTHORS, STORY_INTELLIGENCE_FEED, STORY_INTELLIGENCE_TAGS, STORY_INTELLIGENCE_TITLE,
|
||||||
STORY_PERMALINK, STORY_READ, STORY_SHARE_COUNT, STORY_TAGS, STORY_TITLE, STORY_SOCIAL_USER_ID, STORY_SOURCE_USER_ID, STORY_SHARED_USER_IDS, STORY_FRIEND_USER_IDS, STORY_PUBLIC_USER_IDS, STORY_SUM_TOTAL
|
STORY_PERMALINK, STORY_READ, STORY_SHARE_COUNT, STORY_TAGS, STORY_TITLE, STORY_SOCIAL_USER_ID, STORY_SOURCE_USER_ID, STORY_SHARED_USER_IDS, STORY_FRIEND_USER_IDS, STORY_PUBLIC_USER_IDS, STORY_SUM_TOTAL, STORY_HASH
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -83,6 +83,9 @@ public class Story implements Serializable {
|
||||||
@SerializedName("long_parsed_date")
|
@SerializedName("long_parsed_date")
|
||||||
public String longDate;
|
public String longDate;
|
||||||
|
|
||||||
|
@SerializedName("story_hash")
|
||||||
|
public String storyHash;
|
||||||
|
|
||||||
public ContentValues getValues() {
|
public ContentValues getValues() {
|
||||||
final ContentValues values = new ContentValues();
|
final ContentValues values = new ContentValues();
|
||||||
values.put(DatabaseConstants.STORY_ID, id);
|
values.put(DatabaseConstants.STORY_ID, id);
|
||||||
|
@ -108,6 +111,7 @@ public class Story implements Serializable {
|
||||||
values.put(DatabaseConstants.STORY_TAGS, TextUtils.join(",", tags));
|
values.put(DatabaseConstants.STORY_TAGS, TextUtils.join(",", tags));
|
||||||
values.put(DatabaseConstants.STORY_READ, read);
|
values.put(DatabaseConstants.STORY_READ, read);
|
||||||
values.put(DatabaseConstants.STORY_FEED_ID, feedId);
|
values.put(DatabaseConstants.STORY_FEED_ID, feedId);
|
||||||
|
values.put(DatabaseConstants.STORY_HASH, storyHash);
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,6 +140,7 @@ public class Story implements Serializable {
|
||||||
story.tags = TextUtils.split(cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_TAGS)), ",");
|
story.tags = TextUtils.split(cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_TAGS)), ",");
|
||||||
story.feedId = cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_FEED_ID));
|
story.feedId = cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_FEED_ID));
|
||||||
story.id = cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_ID));
|
story.id = cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_ID));
|
||||||
|
story.storyHash = cursor.getString(cursor.getColumnIndex(DatabaseConstants.STORY_HASH));
|
||||||
return story;
|
return story;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class FeedUtils {
|
||||||
new AsyncTask<Void, Void, NewsBlurResponse>() {
|
new AsyncTask<Void, Void, NewsBlurResponse>() {
|
||||||
@Override
|
@Override
|
||||||
protected NewsBlurResponse doInBackground(Void... arg) {
|
protected NewsBlurResponse doInBackground(Void... arg) {
|
||||||
return apiManager.markStoryAsUnread(story.feedId, story.id);
|
return apiManager.markStoryAsUnread(story.feedId, story.storyHash);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(NewsBlurResponse result) {
|
protected void onPostExecute(NewsBlurResponse result) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue