mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
[backend] We don't need to check for visibility if we already filter for public posts only
This commit is contained in:
parent
6bc42c2a9b
commit
eff0f32dc1
2 changed files with 4 additions and 9 deletions
|
@ -88,7 +88,8 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
ps.sinceDate,
|
||||
ps.untilDate,
|
||||
)
|
||||
.andWhere("(note.visibility = 'public') AND (note.userHost IS NULL)")
|
||||
.andWhere("note.visibility = 'public'")
|
||||
.andWhere("note.userHost IS NULL")
|
||||
.innerJoinAndSelect("note.user", "user")
|
||||
.leftJoinAndSelect("user.avatar", "avatar")
|
||||
.leftJoinAndSelect("user.banner", "banner")
|
||||
|
@ -103,7 +104,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
|
||||
generateChannelQuery(query, user);
|
||||
generateRepliesQuery(query, ps.withReplies, user);
|
||||
generateVisibilityQuery(query, user);
|
||||
if (user) generateMutedUserQuery(query, user);
|
||||
if (user) generateMutedNoteQuery(query, user);
|
||||
if (user) generateBlockedUserQuery(query, user);
|
||||
|
@ -133,7 +133,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
);
|
||||
}
|
||||
}
|
||||
query.andWhere("note.visibility != 'hidden'");
|
||||
//#endregion
|
||||
|
||||
process.nextTick(() => {
|
||||
|
|
|
@ -88,10 +88,8 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
ps.sinceDate,
|
||||
ps.untilDate,
|
||||
)
|
||||
.andWhere(
|
||||
`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`,
|
||||
)
|
||||
.andWhere("(note.visibility = 'public')")
|
||||
.andWhere(`note.userHost IN (:...instances)`, { instances: m.recommendedInstances })
|
||||
.andWhere("note.visibility = 'public'")
|
||||
.innerJoinAndSelect("note.user", "user")
|
||||
.leftJoinAndSelect("user.avatar", "avatar")
|
||||
.leftJoinAndSelect("user.banner", "banner")
|
||||
|
@ -106,7 +104,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
|
||||
generateChannelQuery(query, user);
|
||||
generateRepliesQuery(query, ps.withReplies, user);
|
||||
generateVisibilityQuery(query, user);
|
||||
if (user) generateMutedUserQuery(query, user);
|
||||
if (user) generateMutedNoteQuery(query, user);
|
||||
if (user) generateBlockedUserQuery(query, user);
|
||||
|
@ -136,7 +133,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
);
|
||||
}
|
||||
}
|
||||
query.andWhere("note.visibility != 'hidden'");
|
||||
//#endregion
|
||||
|
||||
process.nextTick(() => {
|
||||
|
|
Loading…
Reference in a new issue