summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-08 14:43:42 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-08 14:43:42 +0900
commit253747ecfb8245d94fe0110e01d8f2ca65a28f5d (patch)
treed28b5c50a7425eaa9313c49cf18aabf86b751ab8 /src
parentMerge pull request #884 from syuilo/add-order-to-migration-files (diff)
downloadsharkey-253747ecfb8245d94fe0110e01d8f2ca65a28f5d.tar.gz
sharkey-253747ecfb8245d94fe0110e01d8f2ca65a28f5d.tar.bz2
sharkey-253747ecfb8245d94fe0110e01d8f2ca65a28f5d.zip
Fix bugs
Diffstat (limited to 'src')
-rw-r--r--src/api/endpoints/drive/stream.ts5
-rw-r--r--src/api/serializers/drive-file.ts2
-rw-r--r--src/web/app/mobile/tags/drive/file-viewer.tag2
3 files changed, 4 insertions, 5 deletions
diff --git a/src/api/endpoints/drive/stream.ts b/src/api/endpoints/drive/stream.ts
index 32f7ac7e0a..58e7d11678 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 3b76979a44..dcdaa01fab 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 e6129652b0..8dc49a0865 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 @@
<p>
<i class="fa fa-hashtag"></i>%i18n:mobile.tags.mk-drive-file-viewer.hash%
</p>
- <code>{ file.hash }</code>
+ <code>{ file.md5 }</code>
</div>
</div>
<style>