Closed xconverge closed 10 months ago
hey! yeah, you should set last_viewed
on some action
So it means that according to the API docs at https://changedetection.io/docs/api_v1/index.html#api-Watch-Update_a_watch you can just call
Just update '{"last_viewed": 1700673833}'
so it means for example
curl http://localhost:4000/api/v1/watch/cc0cfffa-f449-477b-83ea-0caafd1dc091 -X PUT -H"x-api-key:813031b16330fe25e3780cf0325daa45" -H "Content-Type: application/json" -d '{"last_viewed": 1700673833}'
And that will work, can you do that?
or is the above answer something "homepage" can integrate?
Checking diff in frontend does not mark the diff as "seen" in the API
This is kind of misleading issue topic, because theres no way the API can really know the last time your eyes actually saw the diff..
Ah yes perfect, I see now that I need to dive into each specific watch to check the last_viewed, that is exactly what I was looking
This can be closed now, I am not sure it would be unanimously accepted but I will maybe try it for the homepage widget and decide if I want to open a PR, thanks!
Ah yes perfect, I see now that I need to dive into each specific watch to check the last_viewed, that is exactly what I was looking
This can be closed now, I am not sure it would be unanimously accepted but I will maybe try it for the homepage widget and decide if I want to open a PR, thanks!
That would be amazing :) link this issue against your PR there so they see a +1 from me
Can we maybe put the last_viewed field at the top level of the watch endpoint so that I don't need to make separate api calls for each watch I want to check? Looking at the homepage code, it is totally doable to do more fetches but seems a bit messy to me
Up to you, but without it, I probably wont make the change to the homepage project, since I can just run rechecks or wait for rechecks to clear the counter now that I understand the behavior
Oops forgot to quote or tag you so you would get a notification/see this in a closed issue
@dgtlmoon
Can we maybe put the last_viewed field at the top level of the watch endpoint so that I don't need to make separate api calls for each watch I want to check? Looking at the homepage code, it is totally doable to do more fetches but seems a bit messy to me
I dont follow/understand sorry
aaah you are saying when you get the watch information, it does not include "viewed
" right? ( https://changedetection.io/docs/api_v1/index.html#api-Watch-Watch )
is that what you mean by "top level" ?
Ahh there is a bug
curl -s https://hosted/api/v1/watch/ad43465c-9ecc-4b2f-a4fe-683d487a42c1 -H"x-api-key:xxxx" |jq ".viewed"
false
then I click '[diff]`
then retry the API
curl -s https://hosted/api/v1/watch/ad43465c-9ecc-4b2f-a4fe-683d487a42c1 -H"x-api-key:xxxx" |jq ".viewed"
false
aaah you are saying when you get the watch information, it does not include "
viewed
" right? ( https://changedetection.io/docs/api_v1/index.html#api-Watch-Watch )is that what you mean by "top level" ?
Yea, and I could also compute viewed
if last_viewed
was provided (since I have last_changed already).
Basically I would like to be able to derive/get this state/information from a single call to curl -s https://hosted/api/v1/watch
without needing to loop over each watch with changes and make a separate api call
yeah there's a few missing from the API reply, I see it now
watch['viewed']
should be boolean if its been viewed since diff or not
watch['link']
the actual rendered link in the case that you are using Jinja2 in your URL format
watch['label']
will prefer the 'title' over the link
if it is set (same as in the overview list)
watch['newest_history_key']
integer - as it says
i'll check out a fix ASAP, basically just needs something set here to get it from the @property
I'll keep this tagged as bug
because that viewed
status is totally wrong and could affect someone
I use https://github.com/gethomepage/homepage (https://github.com/gethomepage/homepage/blob/main/src/widgets/changedetectionio/widget.js) and noticed that my diffs show as "unread" or "not seen" until they get rechecked, even if I have "viewed" them in the UI.
The code that homepage is using to show a diff is
Is there something else we can expose to the API to potentially use in this widget like "unread" or "new" or something similar to what the frontend uses to bold/unbold the links in the list?
Edit: Sorry this should be a feature request not a bug, it changed as I wrote it