1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Don't forward view, send updates instead

To avoid inconsistencies in the federation, now the origin server will
tell other instances what is the correct number of views
This commit is contained in:
Chocobozzz 2018-11-15 16:18:12 +01:00
parent 650e3d5ce3
commit 030177d246
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 17 additions and 17 deletions

View file

@ -405,7 +405,11 @@ async function viewVideo (req: express.Request, res: express.Response) {
const serverActor = await getServerActor()
await sendCreateView(serverActor, videoInstance, undefined)
// Send the event to the origin server
// If we own the video, we'll send an update event when we'll process the views (in our job queue)
if (videoInstance.isOwned() === false) {
await sendCreateView(serverActor, videoInstance, undefined)
}
return res.status(204).end()
}