summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/admin/drive
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-12-15 00:09:04 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-12-15 00:09:04 +0900
commitebceffba1eb3d762fe164a10ee58fc78547a0a27 (patch)
tree8000bbb47469f637578ad59677a6d19b037fb846 /src/server/api/endpoints/admin/drive
parent:art: (diff)
downloadsharkey-ebceffba1eb3d762fe164a10ee58fc78547a0a27.tar.gz
sharkey-ebceffba1eb3d762fe164a10ee58fc78547a0a27.tar.bz2
sharkey-ebceffba1eb3d762fe164a10ee58fc78547a0a27.zip
Resolve #2165
Diffstat (limited to 'src/server/api/endpoints/admin/drive')
-rw-r--r--src/server/api/endpoints/admin/drive/files.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/api/endpoints/admin/drive/files.ts b/src/server/api/endpoints/admin/drive/files.ts
index 2e54270a0f..6fc83f8191 100644
--- a/src/server/api/endpoints/admin/drive/files.ts
+++ b/src/server/api/endpoints/admin/drive/files.ts
@@ -63,10 +63,12 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
};
}
- const q =
- ps.origin == 'local' ? { host: null } :
- ps.origin == 'remote' ? { host: { $ne: null } } :
- {};
+ const q = {
+ 'metadata.deletedAt': { $exists: false },
+ } as any;
+
+ if (ps.origin == 'local') q['metadata._user.host'] = null;
+ if (ps.origin == 'remote') q['metadata._user.host'] = { $ne: null };
const files = await File
.find(q, {