Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix thread replies API response

Chocobozzz2a021e6cb683
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts
index b216985255..38fa7c3b00 100644
--- a/server/controllers/api/videos/comment.ts
+++ b/server/controllers/api/videos/comment.ts
@@ -166,8 +166,6 @@ async function listVideoThreadComments (req: express.Request, res: express.Respo
}
}
- logger.info('coucou', { resultList })
-
if (resultList.data.length === 0) {
return res.sendStatus(HttpStatusCode.NOT_FOUND_404)
}
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts
index cfd1d5b7a6..dc7556d441 100644
--- a/server/models/video/video-comment.ts
+++ b/server/models/video/video-comment.ts
@@ -483,20 +483,26 @@ export class VideoCommentModel extends Model {
order: [ [ 'createdAt', 'ASC' ], [ 'updatedAt', 'ASC' ] ] as Order,
where: {
videoId,
- [Op.or]: [
- { id: threadId },
- { originCommentId: threadId }
- ],
- [Op.or]: [
+ [Op.and]: [
{
- accountId: {
- [Op.notIn]: Sequelize.literal(
- '(' + buildBlockedAccountSQL(blockerAccountIds) + ')'
- )
- }
+ [Op.or]: [
+ { id: threadId },
+ { originCommentId: threadId }
+ ]
},
{
- accountId: null
+ [Op.or]: [
+ {
+ accountId: {
+ [Op.notIn]: Sequelize.literal(
+ '(' + buildBlockedAccountSQL(blockerAccountIds) + ')'
+ )
+ }
+ },
+ {
+ accountId: null
+ }
+ ]
}
]
}