mirror of
https://github.com/zadam/trilium.git
synced 2025-01-01 04:41:46 +08:00
image sync fixes and 4.0.0 electron
This commit is contained in:
parent
cbec85f295
commit
e9a77f3f16
5 changed files with 25 additions and 16 deletions
20
package-lock.json
generated
20
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "trilium",
|
||||
"version": "0.26.0-beta",
|
||||
"version": "0.26.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -2375,9 +2375,9 @@
|
|||
"integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ=="
|
||||
},
|
||||
"electron": {
|
||||
"version": "4.0.0-beta.11",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-4.0.0-beta.11.tgz",
|
||||
"integrity": "sha512-bn8bVvtur+KK1FlVEOJgXZ24Id3pgqUtQ8kgLhrgSEiIpTu/uNYdhcR+nLYEl4QekIMSLv198lOsx2suyzoyow==",
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-4.0.0.tgz",
|
||||
"integrity": "sha512-3XPG/3IXlvnT1oe1K6zEushoD0SKbP8xwdrL10EWGe6k2iOV4hSHqJ8vWnR8yZ7VbSXmBRfomEFDNAo/q/cwKw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "^8.0.24",
|
||||
|
@ -4331,9 +4331,9 @@
|
|||
}
|
||||
},
|
||||
"get-port": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-port/-/get-port-4.0.0.tgz",
|
||||
"integrity": "sha512-Yy3yNI2oShgbaWg4cmPhWjkZfktEvpKI09aDX4PZzNtlU9obuYrX7x2mumQsrNxlF+Ls7OtMQW/u+X4s896bOQ=="
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-port/-/get-port-4.1.0.tgz",
|
||||
"integrity": "sha512-4/fqAYrzrzOiqDrdeZRKXGdTGgbkfTEumGlNQPeP6Jy8w0PzN9mzeNQ3XgHaTNie8pQ3hOUkrwlZt2Fzk5H9mA=="
|
||||
},
|
||||
"get-proxy": {
|
||||
"version": "1.1.0",
|
||||
|
@ -9179,9 +9179,9 @@
|
|||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||
},
|
||||
"simple-node-logger": {
|
||||
"version": "0.93.40",
|
||||
"resolved": "https://registry.npmjs.org/simple-node-logger/-/simple-node-logger-0.93.40.tgz",
|
||||
"integrity": "sha512-ByWh6D6DgXteLICr5Bhca5CIDxuGt7xOysulWPIrBcwTT6ZCNF4SrwmtIDhC+cSNlJsz/fGytn7mH2Zqyh9euA==",
|
||||
"version": "18.12.21",
|
||||
"resolved": "https://registry.npmjs.org/simple-node-logger/-/simple-node-logger-18.12.21.tgz",
|
||||
"integrity": "sha512-I2dA9JLiNrdTsmOI2bT0mIQNEKhTKbj9OM8tny3Il/5R6QdJHlWrv1NDdS+6UQHEnYV1413FnwgqTjzmV0ctCw==",
|
||||
"requires": {
|
||||
"lodash": "^4.17.10",
|
||||
"moment": "^2.20.1"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
"express": "4.16.4",
|
||||
"express-session": "1.15.6",
|
||||
"fs-extra": "7.0.1",
|
||||
"get-port": "4.0.0",
|
||||
"get-port": "4.1.0",
|
||||
"helmet": "3.15.0",
|
||||
"html": "1.0.0",
|
||||
"image-type": "3.0.0",
|
||||
|
@ -55,7 +55,7 @@
|
|||
"sax": "^1.2.4",
|
||||
"serve-favicon": "2.5.0",
|
||||
"session-file-store": "1.2.0",
|
||||
"simple-node-logger": "0.93.40",
|
||||
"simple-node-logger": "18.12.21",
|
||||
"sqlite": "3.0.0",
|
||||
"tar-stream": "1.6.2",
|
||||
"turndown": "5.0.1",
|
||||
|
@ -65,7 +65,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"devtron": "1.4.0",
|
||||
"electron": "4.0.0-beta.11",
|
||||
"electron": "4.0.0",
|
||||
"electron-compile": "6.4.3",
|
||||
"electron-packager": "13.0.1",
|
||||
"electron-rebuild": "1.8.2",
|
||||
|
|
|
@ -252,7 +252,10 @@ async function getEntityRow(entityName, entityId) {
|
|||
|
||||
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
|
||||
|
||||
if (entityName === 'notes' && (entity.type === 'file' || entity.type === 'image')) {
|
||||
if (entityName === 'notes'
|
||||
&& entity.content !== null
|
||||
&& (entity.type === 'file' || entity.type === 'image')) {
|
||||
|
||||
entity.content = entity.content.toString("binary");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,13 @@ async function get(name) {
|
|||
|
||||
module.exports = {
|
||||
getSyncServerHost: async () => await get('syncServerHost'),
|
||||
isSyncSetup: async () => !!await get('syncServerHost'),
|
||||
isSyncSetup: async () => {
|
||||
const syncServerHost = await get('syncServerHost');
|
||||
|
||||
// special value "disabled" is here to support use case where document is configured with sync server
|
||||
// and we need to override it with config from config.ini
|
||||
return !!syncServerHost && syncServerHost !== 'disabled';
|
||||
},
|
||||
getSyncTimeout: async () => parseInt(await get('syncServerTimeout')),
|
||||
getSyncProxy: async () => await get('syncProxy')
|
||||
};
|
|
@ -39,7 +39,7 @@ async function updateEntity(sync, entity, sourceId) {
|
|||
}
|
||||
|
||||
function deserializeNoteContentBuffer(note) {
|
||||
if (note.type === 'file' || note.type === 'image') {
|
||||
if (note.content !== null && (note.type === 'file' || note.type === 'image')) {
|
||||
note.content = new Buffer(note.content, 'binary');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue