diff --git a/src/api/endpoints/drive/stream.ts b/src/api/endpoints/drive/stream.ts index 32f7ac7e0..58e7d1167 100644 --- a/src/api/endpoints/drive/stream.ts +++ b/src/api/endpoints/drive/stream.ts @@ -52,15 +52,12 @@ module.exports = (params, user) => new Promise(async (res, rej) => { }; } if (type) { - query.type = new RegExp(`^${type.replace(/\*/g, '.+?')}$`); + query.contentType = new RegExp(`^${type.replace(/\*/g, '.+?')}$`); } // Issue query const files = await DriveFile .find(query, { - fields: { - data: false - }, limit: limit, sort: sort }); diff --git a/src/api/serializers/drive-file.ts b/src/api/serializers/drive-file.ts index 3b76979a4..dcdaa01fa 100644 --- a/src/api/serializers/drive-file.ts +++ b/src/api/serializers/drive-file.ts @@ -49,6 +49,8 @@ export default ( _target.created_at = _file.uploadDate; _target.name = _file.filename; _target.type = _file.contentType; + _target.datasize = _file.length; + _target.md5 = _file.md5; _target = Object.assign(_target, _file.metadata); diff --git a/src/web/app/mobile/tags/drive/file-viewer.tag b/src/web/app/mobile/tags/drive/file-viewer.tag index e6129652b..8dc49a086 100644 --- a/src/web/app/mobile/tags/drive/file-viewer.tag +++ b/src/web/app/mobile/tags/drive/file-viewer.tag @@ -44,7 +44,7 @@
%i18n:mobile.tags.mk-drive-file-viewer.hash%
-{ file.hash }
+ { file.md5 }