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

All: Fixes #371 (sort of): Allow resources greater than 10 MB but they won't be synced on mobile

This commit is contained in:
Laurent Cozic
2019-05-12 01:15:52 +01:00
parent 553a26eb63
commit 565dfba8c9
9 changed files with 91 additions and 20 deletions

View File

@ -142,8 +142,8 @@ function shimInit() {
if (resource.mime == 'image/jpeg' || resource.mime == 'image/jpg' || resource.mime == 'image/png') {
const result = await resizeImage_(filePath, targetPath, resource.mime);
} else {
const stat = await shim.fsDriver().stat(filePath);
if (stat.size >= 10000000) throw new Error('Resources larger than 10 MB are not currently supported as they may crash the mobile applications. The issue is being investigated and will be fixed at a later time.');
// const stat = await shim.fsDriver().stat(filePath);
// if (stat.size >= 10000000) throw new Error('Resources larger than 10 MB are not currently supported as they may crash the mobile applications. The issue is being investigated and will be fixed at a later time.');
await fs.copy(filePath, targetPath, { overwrite: true });
}
@ -152,6 +152,9 @@ function shimInit() {
resource = Object.assign({}, resource, defaultProps);
}
const itDoes = await shim.fsDriver().waitTillExists(targetPath);
if (!itDoes) throw new Error('Resource file was not created: ' + targetPath);
const fileStat = await shim.fsDriver().stat(targetPath);
resource.size = fileStat.size;