bcc-code / bcc-media-platform

[BCC Media] Website and backend for the BCC Media apps
https://app.bcc.media
Apache License 2.0
9 stars 4 forks source link

Option to only show prompt to users who have interacted with shorts #1054

Closed mulundapm closed 1 day ago

mulundapm commented 2 weeks ago

Fetch ids of users interested with shorts and put them into unleash

KillerX commented 2 days ago

We will use this prompt to find the user ids that are relevant:

SELECT user_id, count(*) FROM users.media_progress p JOIN public.mediaitems m ON p.item_id = m.id
         JOIN users.profiles pr ON p.profile_id = pr.id
         JOIN users.users u ON pr.user_id = u.id
GROUP BY user_id
ORDER BY count(*) DESC

If we want to, we can in a later stage, automate this more, but for the task at hand it seems sufficient.