From 2a5c19cd0133451b8279843024e2316053ca55c7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 6 Nov 2018 07:52:13 +0900 Subject: リモートのファイルをキャッシュするかどうかの設定をDBに保存するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/meta.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/models/meta.ts') diff --git a/src/models/meta.ts b/src/models/meta.ts index 7caf41f19c..073be7de82 100644 --- a/src/models/meta.ts +++ b/src/models/meta.ts @@ -50,6 +50,17 @@ if ((config as any).remoteDriveCapacityMb) { } }); } +if ((config as any).preventCacheRemoteFiles) { + Meta.findOne({}).then(m => { + if (m != null && m.cacheRemoteFiles == null) { + Meta.update({}, { + $set: { + cacheRemoteFiles: !(config as any).preventCacheRemoteFiles + } + }); + } + }); +} export type IMeta = { name?: string; @@ -66,6 +77,8 @@ export type IMeta = { hidedTags?: string[]; bannerUrl?: string; + cacheRemoteFiles?: boolean; + /** * Drive capacity of a local user (MB) */ -- cgit v1.2.3-freya