fix (backend): note.score is selected by default

This commit is contained in:
naskya 2024-08-03 19:44:16 +09:00
parent 7e0d0b7fcd
commit 6ffd67ce38
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
3 changed files with 0 additions and 3 deletions

View file

@ -19,7 +19,6 @@ export async function injectFeatured(timeline: Note[], user?: User | null) {
const day = 1000 * 60 * 60 * 24 * 3; // 3日前まで const day = 1000 * 60 * 60 * 24 * 3; // 3日前まで
const query = Notes.createQueryBuilder("note") const query = Notes.createQueryBuilder("note")
.addSelect("note.score")
.where("note.userHost IS NULL") .where("note.userHost IS NULL")
.andWhere("note.score > 0") .andWhere("note.score > 0")
.andWhere("note.createdAt > :date", { date: new Date(Date.now() - day) }) .andWhere("note.createdAt > :date", { date: new Date(Date.now() - day) })

View file

@ -42,7 +42,6 @@ export default define(meta, paramDef, async (ps, user) => {
const day = 1000 * 60 * 60 * 24 * ps.days; const day = 1000 * 60 * 60 * 24 * ps.days;
const query = Notes.createQueryBuilder("note") const query = Notes.createQueryBuilder("note")
.addSelect("note.score")
.andWhere("note.score > 0") .andWhere("note.score > 0")
.andWhere("note.createdAt > :date", { date: new Date(Date.now() - day) }) .andWhere("note.createdAt > :date", { date: new Date(Date.now() - day) })
.andWhere("note.visibility = 'public'") .andWhere("note.visibility = 'public'")

View file

@ -360,7 +360,6 @@ export class MiscHelpers {
): Promise<MastodonEntity.Status[]> { ): Promise<MastodonEntity.Status[]> {
if (limit > 40) limit = 40; if (limit > 40) limit = 40;
const query = Notes.createQueryBuilder("note") const query = Notes.createQueryBuilder("note")
.addSelect("note.score")
.andWhere("note.score > 0") .andWhere("note.score > 0")
.andWhere("note.createdAt > :date", { .andWhere("note.createdAt > :date", {
date: new Date(Date.now() - 1000 * 60 * 60 * 24), date: new Date(Date.now() - 1000 * 60 * 60 * 24),