mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-28 06:48:12 +09:00
days for featured
This commit is contained in:
parent
ae53b4e5d3
commit
dac3b02a3f
@ -32,17 +32,17 @@ export const paramDef = {
|
|||||||
enum: ["combined", "local", "remote"],
|
enum: ["combined", "local", "remote"],
|
||||||
default: "local",
|
default: "local",
|
||||||
},
|
},
|
||||||
|
days: { type: "integer", minimum: 1, maximum: 365, default: 3 },
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export default define(meta, paramDef, async (ps, user) => {
|
export default define(meta, paramDef, async (ps, user) => {
|
||||||
const max = 30;
|
const max = 30;
|
||||||
const day = 1000 * 60 * 60 * 24 * 3; // 3日前まで
|
const day = 1000 * 60 * 60 * 24 * ps.days;
|
||||||
|
|
||||||
const query = Notes.createQueryBuilder("note")
|
const query = Notes.createQueryBuilder("note")
|
||||||
.addSelect("note.score")
|
.addSelect("note.score")
|
||||||
// .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) })
|
||||||
.andWhere("note.visibility = 'public'")
|
.andWhere("note.visibility = 'public'")
|
||||||
|
@ -19,6 +19,9 @@ const paginationForLocal = {
|
|||||||
limit: 10,
|
limit: 10,
|
||||||
origin: 'local',
|
origin: 'local',
|
||||||
offsetMode: true,
|
offsetMode: true,
|
||||||
|
params: {
|
||||||
|
days: 14,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const paginationForRemote = {
|
const paginationForRemote = {
|
||||||
@ -27,6 +30,7 @@ const paginationForRemote = {
|
|||||||
offsetMode: true,
|
offsetMode: true,
|
||||||
params: {
|
params: {
|
||||||
origin: 'remote',
|
origin: 'remote',
|
||||||
|
days: 7,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user