1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Simplifying serialisation of base items

This commit is contained in:
Laurent Cozic
2018-10-07 20:11:33 +01:00
parent 127dce1cd6
commit 124a959c8d
8 changed files with 20 additions and 43 deletions

View File

@ -35,13 +35,6 @@ class Resource extends BaseItem {
return Resource.fsDriver_;
}
static async serialize(item, type = null, shownKeys = null) {
let fieldNames = this.fieldNames();
fieldNames.push('type_');
//fieldNames = ArrayUtils.removeElement(fieldNames, 'encryption_blob_encrypted');
return super.serialize(item, 'resource', fieldNames);
}
static filename(resource, encryptedBlob = false) {
let extension = encryptedBlob ? 'crypted' : resource.file_extension;
if (!extension) extension = resource.mime ? mime.toFileExtension(resource.mime) : '';
@ -199,4 +192,9 @@ class Resource extends BaseItem {
Resource.IMAGE_MAX_DIMENSION = 1920;
Resource.FETCH_STATUS_IDLE = 0;
Resource.FETCH_STATUS_STARTED = 1;
Resource.FETCH_STATUS_DONE = 2;
Resource.FETCH_STATUS_ERROR = 3;
module.exports = Resource;