summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-05 10:23:58 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-05 10:23:58 +0900
commit2333bdb98ae88b9a6018bf4b11479a241ea77f0e (patch)
treedaefad276c785f2c38c751471cc4d1ae7c3f742f /packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts
parenttweak ui (diff)
downloadsharkey-2333bdb98ae88b9a6018bf4b11479a241ea77f0e.tar.gz
sharkey-2333bdb98ae88b9a6018bf4b11479a241ea77f0e.tar.bz2
sharkey-2333bdb98ae88b9a6018bf4b11479a241ea77f0e.zip
fix(backend): sinceIdやsinceDateを利用してTLを取得することができない
Fix #11961
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts')
-rw-r--r--packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts
index cae749bb88..8e7f2a2a98 100644
--- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts
+++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts
@@ -91,7 +91,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
let timeline: MiNote[] = [];
- const limit = ps.limit + (ps.untilId ? 1 : 0); // untilIdに指定したものも含まれるため+1
+ const limit = ps.limit + (ps.untilId ? 1 : 0) + (ps.sinceId ? 1 : 0); // untilIdに指定したものも含まれるため+1
let htlNoteIdsRes: [string, string[]][] = [];
let ltlNoteIdsRes: [string, string[]][] = [];
@@ -100,18 +100,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
this.redisForTimelines.xrevrange(
ps.withFiles ? `homeTimelineWithFiles:${me.id}` : `homeTimeline:${me.id}`,
ps.untilId ? this.idService.parse(ps.untilId).date.getTime() : ps.untilDate ?? '+',
- '-',
+ ps.sinceId ? this.idService.parse(ps.sinceId).date.getTime() : ps.sinceDate ?? '-',
'COUNT', limit),
this.redisForTimelines.xrevrange(
ps.withFiles ? 'localTimelineWithFiles' : 'localTimeline',
ps.untilId ? this.idService.parse(ps.untilId).date.getTime() : ps.untilDate ?? '+',
- '-',
+ ps.sinceId ? this.idService.parse(ps.sinceId).date.getTime() : ps.sinceDate ?? '-',
'COUNT', limit),
]);
}
- const htlNoteIds = htlNoteIdsRes.map(x => x[1][1]).filter(x => x !== ps.untilId);
- const ltlNoteIds = ltlNoteIdsRes.map(x => x[1][1]).filter(x => x !== ps.untilId);
+ const htlNoteIds = htlNoteIdsRes.map(x => x[1][1]).filter(x => x !== ps.untilId && x !== ps.sinceId);
+ const ltlNoteIds = ltlNoteIdsRes.map(x => x[1][1]).filter(x => x !== ps.untilId && x !== ps.sinceId);
let noteIds = Array.from(new Set([...htlNoteIds, ...ltlNoteIds]));
noteIds.sort((a, b) => a > b ? -1 : 1);
noteIds = noteIds.slice(0, ps.limit);