1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Fix trending page

This commit is contained in:
Chocobozzz 2018-12-03 09:14:56 +01:00
parent 1a8dd4da77
commit dbe6aa698e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 21 additions and 12 deletions

View file

@ -87,10 +87,19 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea
async function processCreateView (byActor: ActorModel, activity: ActivityCreate) {
const view = activity.object as ViewObject
const video = await VideoModel.loadByUrl(view.object)
if (!video || video.isOwned() === false) return
const options = {
videoObject: view.object,
fetchType: 'only-video' as 'only-video'
}
const { video } = await getOrCreateVideoAndAccountAndChannel(options)
await Redis.Instance.addVideoView(video.id)
if (video.isOwned()) {
// Don't resend the activity to the sender
const exceptions = [ byActor ]
await forwardVideoRelatedActivity(activity, undefined, exceptions, video)
}
}
async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) {