Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,34 @@
import Chart from "../core.js";
import { Notes } from "../../../models/index.js";
import { name, schema } from "./entities/per-user-notes.js";
/**
* ユーザーごとのノートに関するチャート
*/ export default class PerUserNotesChart extends Chart {
constructor(){
super(name, schema, true);
}
async tickMajor(group) {
const [count] = await Promise.all([
Notes.countBy({
userId: group
})
]);
return {
total: count
};
}
async tickMinor() {
return {};
}
async update(user, note, isAdditional) {
await this.commit({
total: isAdditional ? 1 : -1,
inc: isAdditional ? 1 : 0,
dec: isAdditional ? 0 : 1,
"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);
}
}