summaryrefslogtreecommitdiff
path: root/src/models
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-11-06 07:14:43 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-11-06 07:14:43 +0900
commit8f714b5b126226346af850337566f0f70bd02d4f (patch)
treef647ad5b28e5a4e74a7f7501c09597a1f8f11a81 /src/models
parentClean up (diff)
downloadmisskey-8f714b5b126226346af850337566f0f70bd02d4f.tar.gz
misskey-8f714b5b126226346af850337566f0f70bd02d4f.tar.bz2
misskey-8f714b5b126226346af850337566f0f70bd02d4f.zip
ドライブ容量の設定をDBに保存するようにしたりリファクタリングしたり
Diffstat (limited to 'src/models')
-rw-r--r--src/models/meta.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/models/meta.ts b/src/models/meta.ts
index d8a9b46037..7caf41f19c 100644
--- a/src/models/meta.ts
+++ b/src/models/meta.ts
@@ -28,6 +28,28 @@ if ((config as any).description) {
}
});
}
+if ((config as any).localDriveCapacityMb) {
+ Meta.findOne({}).then(m => {
+ if (m != null && m.localDriveCapacityMb == null) {
+ Meta.update({}, {
+ $set: {
+ localDriveCapacityMb: (config as any).localDriveCapacityMb
+ }
+ });
+ }
+ });
+}
+if ((config as any).remoteDriveCapacityMb) {
+ Meta.findOne({}).then(m => {
+ if (m != null && m.remoteDriveCapacityMb == null) {
+ Meta.update({}, {
+ $set: {
+ remoteDriveCapacityMb: (config as any).remoteDriveCapacityMb
+ }
+ });
+ }
+ });
+}
export type IMeta = {
name?: string;
@@ -45,6 +67,16 @@ export type IMeta = {
bannerUrl?: string;
/**
+ * Drive capacity of a local user (MB)
+ */
+ localDriveCapacityMb?: number;
+
+ /**
+ * Drive capacity of a remote user (MB)
+ */
+ remoteDriveCapacityMb?: number;
+
+ /**
* Max allowed note text length in charactors
*/
maxNoteTextLength?: number;