mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
added contentLength to note entity
This commit is contained in:
@@ -139,12 +139,6 @@ async function importEnex(taskContext, file, parentNote) {
|
||||
text = text.replace(/\s/g, '');
|
||||
|
||||
resource.content = utils.fromBase64(text);
|
||||
|
||||
resource.attributes.push({
|
||||
type: 'label',
|
||||
name: 'fileSize',
|
||||
value: resource.content.length
|
||||
});
|
||||
}
|
||||
else if (currentTag === 'mime') {
|
||||
resource.mime = text.toLowerCase();
|
||||
|
||||
@@ -48,10 +48,7 @@ async function importFile(taskContext, file, parentNote) {
|
||||
isProtected: parentNote.isProtected && protectedSessionService.isProtectedSessionAvailable(),
|
||||
type: 'file',
|
||||
mime: mimeService.getMime(originalName) || file.mimetype,
|
||||
attributes: [
|
||||
{ type: "label", name: "originalFileName", value: originalName },
|
||||
{ type: "label", name: "fileSize", value: size }
|
||||
]
|
||||
attributes: [{ type: "label", name: "originalFileName", value: originalName }]
|
||||
});
|
||||
|
||||
taskContext.increaseProgressCount();
|
||||
|
||||
@@ -352,13 +352,6 @@ async function importTar(taskContext, fileBuffer, importRootNote) {
|
||||
name: 'originalFileName',
|
||||
value: path.basename(filePath)
|
||||
});
|
||||
|
||||
attributes.push({
|
||||
noteId,
|
||||
type: 'label',
|
||||
name: 'fileSize',
|
||||
value: content.byteLength
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user