mirror of https://github.com/readrops/Readrops.git
Set modified items read state for Nextcloud news sync
This commit is contained in:
parent
ae1d9f056a
commit
49cafbb062
|
@ -300,8 +300,8 @@ public class NextNewsRepository extends ARepository<NextNewsAPI> {
|
||||||
for (NextNewsItem nextNewsItem : items) {
|
for (NextNewsItem nextNewsItem : items) {
|
||||||
int feedId = database.feedDao().getFeedIdByRemoteId(String.valueOf(nextNewsItem.getFeedId()), account.getId());
|
int feedId = database.feedDao().getFeedIdByRemoteId(String.valueOf(nextNewsItem.getFeedId()), account.getId());
|
||||||
|
|
||||||
if (!initialSync && feedId > 0) {
|
if (!initialSync && feedId > 0 && database.itemDao().remoteItemExists(String.valueOf(nextNewsItem.getId()), feedId)) {
|
||||||
if (database.itemDao().remoteItemExists(String.valueOf(nextNewsItem.getId()), feedId))
|
database.itemDao().setReadState(String.valueOf(nextNewsItem.getId()), !nextNewsItem.isUnread());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +311,9 @@ public class NextNewsRepository extends ARepository<NextNewsAPI> {
|
||||||
newItems.add(item);
|
newItems.add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!newItems.isEmpty()) {
|
||||||
Collections.sort(newItems, Item::compareTo);
|
Collections.sort(newItems, Item::compareTo);
|
||||||
database.itemDao().insert(newItems);
|
database.itemDao().insert(newItems);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue