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:
parent
1a8dd4da77
commit
dbe6aa698e
3 changed files with 21 additions and 12 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue