diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-08 23:12:37 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-02-08 23:12:37 +0900 |
| commit | adf3493af855cc23e3e4b82c2fa462e05c4a26c1 (patch) | |
| tree | 300d7251bef9b09405242636e5d39c3633367d01 /packages/backend/src/services/chart | |
| parent | chore: remove unused code (diff) | |
| download | sharkey-adf3493af855cc23e3e4b82c2fa462e05c4a26c1.tar.gz sharkey-adf3493af855cc23e3e4b82c2fa462e05c4a26c1.tar.bz2 sharkey-adf3493af855cc23e3e4b82c2fa462e05c4a26c1.zip | |
feat: notes/instance/perUserNotesチャートに添付ファイル付きノートの数を追加
Diffstat (limited to 'packages/backend/src/services/chart')
6 files changed, 7 insertions, 0 deletions
diff --git a/packages/backend/src/services/chart/charts/entities/instance.ts b/packages/backend/src/services/chart/charts/entities/instance.ts index 0ff9e7b6b8..b98e1640c8 100644 --- a/packages/backend/src/services/chart/charts/entities/instance.ts +++ b/packages/backend/src/services/chart/charts/entities/instance.ts @@ -12,6 +12,7 @@ export const schema = { 'notes.diffs.normal': {}, 'notes.diffs.reply': {}, 'notes.diffs.renote': {}, + 'notes.diffs.withFile': {}, 'users.total': { accumulate: true }, 'users.inc': { range: 'small' }, 'users.dec': { range: 'small' }, diff --git a/packages/backend/src/services/chart/charts/entities/notes.ts b/packages/backend/src/services/chart/charts/entities/notes.ts index 296328f102..f9b9b20eed 100644 --- a/packages/backend/src/services/chart/charts/entities/notes.ts +++ b/packages/backend/src/services/chart/charts/entities/notes.ts @@ -9,12 +9,14 @@ export const schema = { 'local.diffs.normal': {}, 'local.diffs.reply': {}, 'local.diffs.renote': {}, + 'local.diffs.withFile': {}, 'remote.total': { accumulate: true }, 'remote.inc': {}, 'remote.dec': {}, 'remote.diffs.normal': {}, 'remote.diffs.reply': {}, 'remote.diffs.renote': {}, + 'remote.diffs.withFile': {}, } as const; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/services/chart/charts/entities/per-user-notes.ts b/packages/backend/src/services/chart/charts/entities/per-user-notes.ts index bf7e4422be..562cde9b00 100644 --- a/packages/backend/src/services/chart/charts/entities/per-user-notes.ts +++ b/packages/backend/src/services/chart/charts/entities/per-user-notes.ts @@ -9,6 +9,7 @@ export const schema = { 'diffs.normal': { range: 'small' }, 'diffs.reply': { range: 'small' }, 'diffs.renote': { range: 'small' }, + 'diffs.withFile': { range: 'small' }, } as const; export const entity = Chart.schemaToEntity(name, schema, true); diff --git a/packages/backend/src/services/chart/charts/instance.ts b/packages/backend/src/services/chart/charts/instance.ts index 4f953cd690..5ea4d567e1 100644 --- a/packages/backend/src/services/chart/charts/instance.ts +++ b/packages/backend/src/services/chart/charts/instance.ts @@ -74,6 +74,7 @@ export default class InstanceChart extends Chart<typeof schema> { 'notes.diffs.normal': note.replyId == null && note.renoteId == null ? (isAdditional ? 1 : -1) : 0, 'notes.diffs.renote': note.renoteId != null ? (isAdditional ? 1 : -1) : 0, 'notes.diffs.reply': note.replyId != null ? (isAdditional ? 1 : -1) : 0, + 'notes.diffs.withFile': note.fileIds.length > 0 ? (isAdditional ? 1 : -1) : 0, }, toPuny(host)); } diff --git a/packages/backend/src/services/chart/charts/notes.ts b/packages/backend/src/services/chart/charts/notes.ts index 4bbfa6704f..5c56a9a718 100644 --- a/packages/backend/src/services/chart/charts/notes.ts +++ b/packages/backend/src/services/chart/charts/notes.ts @@ -38,6 +38,7 @@ export default class NotesChart extends Chart<typeof schema> { [`${prefix}.diffs.normal`]: note.replyId == null && note.renoteId == null ? (isAdditional ? 1 : -1) : 0, [`${prefix}.diffs.renote`]: note.renoteId != null ? (isAdditional ? 1 : -1) : 0, [`${prefix}.diffs.reply`]: note.replyId != null ? (isAdditional ? 1 : -1) : 0, + [`${prefix}.diffs.withFile`]: note.fileIds.length > 0 ? (isAdditional ? 1 : -1) : 0, }); } } diff --git a/packages/backend/src/services/chart/charts/per-user-notes.ts b/packages/backend/src/services/chart/charts/per-user-notes.ts index ead353139b..6a4f0363b2 100644 --- a/packages/backend/src/services/chart/charts/per-user-notes.ts +++ b/packages/backend/src/services/chart/charts/per-user-notes.ts @@ -34,6 +34,7 @@ export default class PerUserNotesChart extends Chart<typeof schema> { 'diffs.normal': note.replyId == null && note.renoteId == null ? (isAdditional ? 1 : -1) : 0, 'diffs.renote': note.renoteId != null ? (isAdditional ? 1 : -1) : 0, 'diffs.reply': note.replyId != null ? (isAdditional ? 1 : -1) : 0, + 'diffs.withFile': note.fileIds.length > 0 ? (isAdditional ? 1 : -1) : 0, }, user.id); } } |