diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-02-18 11:47:25 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-02-18 11:47:25 +0900 |
| commit | 0e046faf4afb7db260ea4797e8cf32ad13d70c6c (patch) | |
| tree | ec5e413011c0168ff4190edba678136c1d082b46 /src/models | |
| parent | ユーザーが存在しない場合の表示を追加 (diff) | |
| download | misskey-0e046faf4afb7db260ea4797e8cf32ad13d70c6c.tar.gz misskey-0e046faf4afb7db260ea4797e8cf32ad13d70c6c.tar.bz2 misskey-0e046faf4afb7db260ea4797e8cf32ad13d70c6c.zip | |
みつけるの人気のタグを第2ソートで連合含めたユーザー数にしたりユーザーのタグ以外は除外するように
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/hashtag.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/models/hashtag.ts b/src/models/hashtag.ts index 742e4a254c..c1de42086e 100644 --- a/src/models/hashtag.ts +++ b/src/models/hashtag.ts @@ -5,8 +5,10 @@ const Hashtag = db.get<IHashtags>('hashtags'); Hashtag.createIndex('tag', { unique: true }); Hashtag.createIndex('mentionedUsersCount'); Hashtag.createIndex('mentionedLocalUsersCount'); +Hashtag.createIndex('mentionedRemoteUsersCount'); Hashtag.createIndex('attachedUsersCount'); Hashtag.createIndex('attachedLocalUsersCount'); +Hashtag.createIndex('attachedRemoteUsersCount'); export default Hashtag; // 後方互換性のため @@ -29,6 +31,20 @@ Hashtag.findOne({ attachedUserIds: { $exists: false }}).then(h => { }); } }); +Hashtag.findOne({ attachedRemoteUserIds: { $exists: false }}).then(h => { + if (h != null) { + Hashtag.update({}, { + $set: { + mentionedRemoteUserIds: [], + mentionedRemoteUsersCount: 0, + attachedRemoteUserIds: [], + attachedRemoteUsersCount: 0, + } + }, { + multi: true + }); + } +}); export interface IHashtags { tag: string; @@ -36,8 +52,12 @@ export interface IHashtags { mentionedUsersCount: number; mentionedLocalUserIds: mongo.ObjectID[]; mentionedLocalUsersCount: number; + mentionedRemoteUserIds: mongo.ObjectID[]; + mentionedRemoteUsersCount: number; attachedUserIds: mongo.ObjectID[]; attachedUsersCount: number; attachedLocalUserIds: mongo.ObjectID[]; attachedLocalUsersCount: number; + attachedRemoteUserIds: mongo.ObjectID[]; + attachedRemoteUsersCount: number; } |