-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.1.1.: Video relevance fixes (#350)
- Loading branch information
Showing
16 changed files
with
117 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "orion", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { EntityManager, In } from 'typeorm' | ||
import { CommentCountersManager } from '../../../utils/CommentsCountersManager' | ||
import { Comment } from '../../../model' | ||
import { commentCountersManager } from '../../utils' | ||
|
||
export async function processCommentsCensorshipStatusUpdate(em: EntityManager, ids: string[]) { | ||
const manager = new CommentCountersManager() | ||
const comments = await em.getRepository(Comment).find({ where: { id: In(ids) } }) | ||
comments.forEach((c) => { | ||
manager.scheduleRecalcForComment(c.parentCommentId) | ||
manager.scheduleRecalcForVideo(c.videoId) | ||
commentCountersManager.scheduleRecalcForComment(c.parentCommentId) | ||
commentCountersManager.scheduleRecalcForVideo(c.videoId) | ||
}) | ||
await manager.updateVideoCommentsCounters(em) | ||
await manager.updateParentRepliesCounters(em) | ||
await commentCountersManager.updateVideoCommentsCounters(em) | ||
await commentCountersManager.updateParentRepliesCounters(em) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { EntityManager } from 'typeorm' | ||
import { CommentCountersManager } from '../utils/CommentsCountersManager' | ||
import { VideoRelevanceManager } from '../utils/VideoRelevanceManager' | ||
|
||
export const commentCountersManager = new CommentCountersManager() | ||
export const videoRelevanceManager = new VideoRelevanceManager() | ||
|
||
videoRelevanceManager.turnOnVideoRelevanceManager() | ||
|
||
export async function recalculateAllVideosRelevance(em: EntityManager) { | ||
return videoRelevanceManager.updateVideoRelevanceValue(em, true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters