1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Save size of a resource to the database; and added mechanism to run non-database migrations

This commit is contained in:
Laurent Cozic
2019-05-11 17:55:40 +01:00
parent e96bc9c48a
commit 9c85bc2cd1
11 changed files with 128 additions and 3 deletions

View File

@ -408,12 +408,18 @@ function importEnex(parentFolderId, filePath, importOptions = null) {
debugTemp.data = debugTemp.data ? debugTemp.data.substr(0, 32) + '...' : debugTemp.data;
importOptions.onError(new Error('This resource was not added because it has no ID or no content: ' + JSON.stringify(debugTemp)));
} else {
let size = 0;
if (decodedData) {
size = 'byteLength' in decodedData ? decodedData.byteLength : decodedData.length;
}
let r = {
id: resourceId,
data: decodedData,
mime: noteResource.mime,
title: noteResource.filename ? noteResource.filename : '',
filename: noteResource.filename ? noteResource.filename : '',
size: size,
};
note.resources.push(r);