1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Implement auto tag on comments and videos

* Comments and videos can be automatically tagged using core rules or
   watched word lists
 * These tags can be used to automatically filter videos and comments
 * Introduce a new video comment policy where comments must be approved
   first
 * Comments may have to be approved if the user auto block them using
   core rules or watched word lists
 * Implement FEP-5624 to federate reply control policies
This commit is contained in:
Chocobozzz 2024-03-29 14:25:03 +01:00 committed by Chocobozzz
parent b3e39df59e
commit 29329d6c45
241 changed files with 8090 additions and 1399 deletions

View file

@ -1,6 +1,6 @@
import isPlainObject from 'lodash-es/isPlainObject.js'
import { Model as SequelizeModel, ModelStatic, Sequelize } from 'sequelize'
import { logger } from '@server/helpers/logger.js'
import isPlainObject from 'lodash-es/isPlainObject.js'
import { ModelStatic, Sequelize, Model as SequelizeModel } from 'sequelize'
/**
*
@ -49,7 +49,7 @@ export class ModelBuilder <T extends SequelizeModel> {
// Child model
if (isPlainObject(value)) {
const { created, model: subModel } = this.createModel(value, key, keyPath + '.' + json.id + '.' + key)
const { created, model: subModel } = this.createModel(value, key, `${keyPath}.${json.id}.${key}`)
if (!created || !subModel) continue
const Model = this.findModelBuilder(modelName)
@ -108,6 +108,7 @@ export class ModelBuilder <T extends SequelizeModel> {
if (modelName === 'ActorFollowing') return 'ActorModel'
if (modelName === 'ActorFollower') return 'ActorModel'
if (modelName === 'FlaggedAccount') return 'AccountModel'
if (modelName === 'CommentAutomaticTags') return 'CommentAutomaticTagModel'
return modelName + 'Model'
}