Conversation
cb6619e to
25a1210
Compare
25a1210 to
72f03cd
Compare
| if preferences.notifications && was_insert | ||
| Invidious::Database::Users.add_notification(video) |
There was a problem hiding this comment.
Note that you can't check the preferences in here: this function is called by the refresh job and hence lacks any user context. We need to add a column to the postgres table users so we can do the following:
UPDATE ...
SET array_append(subscriptions, '<video_id>')
WHERE notifications = true AND '<ucid>' = ANY(subscriptions)There was a problem hiding this comment.
We can't do that until we have #2878 merged then?
There was a problem hiding this comment.
Mmh the query you are talking about, is it this one: https://github.com/iv-org/invidious/blob/master/src/invidious/database/users.cr#L100?
We could just temporarily convert the preferences column to a json object then check in a where clause which user has notifications enabled.
There was a problem hiding this comment.
Yep, it's better to wait for 2878 to be merged, so we can start some work on the DB.
And no, the function that updates notifications is this one:
invidious/src/invidious/database/users.cr
Lines 122 to 131 in 081fd54
As for the temporary solution, Imo it would be preferrable to not clutter the code now.
|
@unixfox do you mind if I close this PR? |
I don't know why you really want to close this PR but if you think you have to do it then you can close it. |
|
This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked. |
|
This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked. |
|
This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked. |
|
This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked. |
|
I guess this can be closed, now that #3473 has been merged? |
No it's per user here, no globally. |
|
This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked. |
This PR adds the ability to disable notifications.
In error: