summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-06 17:01:06 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-06 17:01:06 +0900
commit7d289c1b772bf94265ee7c7a49df1a6eca371fa7 (patch)
tree2817717f66f6c2d2a9eca766944ec2cba60d1184 /packages/backend/src
parentrefactor (diff)
downloadsharkey-7d289c1b772bf94265ee7c7a49df1a6eca371fa7.tar.gz
sharkey-7d289c1b772bf94265ee7c7a49df1a6eca371fa7.tar.bz2
sharkey-7d289c1b772bf94265ee7c7a49df1a6eca371fa7.zip
refactor
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/FeaturedService.ts14
1 files changed, 4 insertions, 10 deletions
diff --git a/packages/backend/src/core/FeaturedService.ts b/packages/backend/src/core/FeaturedService.ts
index 5963b7fc39..e8a08cd866 100644
--- a/packages/backend/src/core/FeaturedService.ts
+++ b/packages/backend/src/core/FeaturedService.ts
@@ -20,12 +20,6 @@ export class FeaturedService {
}
@bindThis
- private getCurrentPerUserFriendRankingWindow(): number {
- const passed = new Date().getTime() - new Date(new Date().getFullYear(), 0, 1).getTime();
- return Math.floor(passed / (1000 * 60 * 60 * 24 * 7)); // 1週間ごと
- }
-
- @bindThis
private getCurrentWindow(windowRange: number): number {
const passed = new Date().getTime() - new Date(new Date().getFullYear(), 0, 1).getTime();
return Math.floor(passed / windowRange);
@@ -79,22 +73,22 @@ export class FeaturedService {
}
@bindThis
- public async updateGlobalNotesRanking(noteId: MiNote['id'], score = 1): Promise<void> {
+ public updateGlobalNotesRanking(noteId: MiNote['id'], score = 1): Promise<void> {
return this.updateRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
}
@bindThis
- public async updateInChannelNotesRanking(noteId: MiNote['id'], channelId: MiNote['channelId'], score = 1): Promise<void> {
+ public updateInChannelNotesRanking(noteId: MiNote['id'], channelId: MiNote['channelId'], score = 1): Promise<void> {
return this.updateRankingOf(`featuredInChannelNotesRanking:${channelId}`, GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
}
@bindThis
- public async getGlobalNotesRanking(limit: number): Promise<MiNote['id'][]> {
+ public getGlobalNotesRanking(limit: number): Promise<MiNote['id'][]> {
return this.getRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, limit);
}
@bindThis
- public async getInChannelNotesRanking(channelId: MiNote['channelId'], limit: number): Promise<MiNote['id'][]> {
+ public getInChannelNotesRanking(channelId: MiNote['channelId'], limit: number): Promise<MiNote['id'][]> {
return this.getRankingOf(`featuredInChannelNotesRanking:${channelId}`, GLOBAL_NOTES_RANKING_WINDOW, limit);
}
}