Recommendations policy - #7633
Conversation
This commit adds a new option attached to a video, that allows to chose which kind of recommendation will appear below it in the viewer. It currently allows four setups: - Any video (same as currently) - Local videos only - Owner videos only - Same channel videos only This allows the user who owns the video to restrict the recommendations associated to his videos.
|
Thank you. Before reviewing this PR in detail, please:
|
Just to make sure I understand this point correctly: The current endpoint format (as I implemented it) is '/api/v1/videos/{uuid}/recommendations', and you are talking about '/api/v1/recommendations/videos', is it just an omission in your comment and you actually meant '/api/v1/videos/{uuid}/recommendations/videos'? (because we already have uuid-namespaced endpoints, so it made sense to me to namespace it in this case too). Then: is your request an addition to what I implemented? so by default we would use the video (or admin) policy, unless a query param is specified in which case we use the query param? Or is it in place of it? (so I would need to pass the preference to the client and then the client decides the strategy when it queries the recommendation, and the endpoint itself would be actually "stateless"?) |
Maybe I miss some federation feature, but I don’t see how this preference makes sense in a federation context, do you have an example scenario in mind? |
I would like to create a recommendation endpoint under
I suggest having a stateless REST API endpoint, accepting parameters to the client choose the recommendation algorithm it wants. Your PR implementation allows the uploader to decide the recommended algorithm, but we may envisage in the future that the viewer can also override the algorithm. It will be up to the client to decide which preference it wants to apply.
You upload a video on peertube1.example.com and ask PeerTube to recommend only local videos to viewers. Viewers watching the video on peertube2.example.com should see videos of peertube1.example.com as recommendations |
|
Understood, I’ll see how to do that |
|
Any news on this PR? |
I’m lacking time to work on it for now, sorry. (note: two weeks for the first review was a bit too long for me: I tried looking at the code after the review and since I’m not a regular contributor it was as if I saw it for the first time, so I gave up and didn’t have courage to go back to it since then) |
I know and I'm sorry about that. I'll try to decrease review lag in the future (I was on holidays when you created the PR) |
Description
This commit adds a new option attached to a video, that allows to chose which kind of recommendation will appear below it in the viewer. It currently allows four setups:
This allows the user who owns the video to restrict the recommendations associated to his videos.
AI disclaimer: Tests were written in big part with AI help. It also sketched me a draft of the feature implementation but no line of this draft remain in this PR, it helped mostly with providing indications and relevant code locations since I’m not familiar with the project.
Related issues
#1600
Has this been tested?
Screenshots