news-android icon indicating copy to clipboard operation
news-android copied to clipboard

Articles marked as read are not correctly synced

Open tobiasKaminsky opened this issue 1 year ago • 0 comments

As I have way too many news, I have a script that marks all articles older than 3 days as read:

#!/bin/bash

ids=$(mysql -unextcloud -pPASS -s -r -e "use nextcloud; SELECT id FROM oc_news_items where feed_id IN (SELECT id FROM oc_news_feeds where user_id like 'USER') and (unread = 1 and starred = 0) and pub_date <= UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))" | grep -v id | sed -z s'#\n#,#g' | sed s'#,$##')

json="{ \"items\": [ $ids ] }"

curl --request PUT \
  --url https://nextcloud.kaminsky.me/apps/news/api/v1-2/items/read/multiple \
  --header 'Authorization: Basic TOKEN==' \
  --header 'Content-Type: application/json' \
  --data "$json"

As you can see i select id, then use API to mark them as read. This works as intended. On web ui: 64 items, oldest 3 days ago On Android: 315, oldest 4 weeks ago

Somehow some articles are marked as read, some not.

tobiasKaminsky avatar Sep 19 '22 06:09 tobiasKaminsky