feat: per user featured notes

This commit is contained in:
syuilo
2023-10-06 18:30:08 +09:00
parent adf9d9c969
commit a5b6e807bb
11 changed files with 116 additions and 11 deletions

View File

@@ -195,9 +195,10 @@ export class ReactionService {
// 30%の確率でハイライト用ランキング更新
if (Math.random() < 0.3 && note.userId !== user.id) {
if (note.channelId != null) {
this.featuredService.updateInChannelNotesRanking(note.id, note.channelId, 1);
this.featuredService.updateInChannelNotesRanking(note.channelId, note.id, 1);
} else if (note.visibility === 'public' && note.userHost == null) {
this.featuredService.updateGlobalNotesRanking(note.id, 1);
this.featuredService.updatePerUserNotesRanking(note.userId, note.id, 1);
}
}