mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-03-29 05:05:17 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9747c26d50 | ||
|
|
bb4b764586 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-livesync",
|
||||
"name": "Self-hosted LiveSync",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"minAppVersion": "0.9.12",
|
||||
"description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
|
||||
"author": "vorotamoroz",
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"diff-match-patch": "^1.0.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
|
||||
"main": "main.js",
|
||||
"type": "module",
|
||||
|
||||
2
src/lib
2
src/lib
Submodule src/lib updated: 2ea80a40c1...f9aeaf6a2d
@@ -1306,9 +1306,9 @@ Note: We can always able to read V1 format. It will be progressively converted.
|
||||
try {
|
||||
let outFile;
|
||||
if (mode == "create") {
|
||||
outFile = await createFile(normalizePath(path), writeData, { ctime: doc.ctime, mtime: doc.mtime, });
|
||||
outFile = await createFile(this.app,normalizePath(path), writeData, { ctime: doc.ctime, mtime: doc.mtime, });
|
||||
} else {
|
||||
await modifyFile(file, writeData, { ctime: doc.ctime, mtime: doc.mtime });
|
||||
await modifyFile(this.app,file, writeData, { ctime: doc.ctime, mtime: doc.mtime });
|
||||
outFile = getAbstractFileByPath(getPathFromTFile(file)) as TFile;
|
||||
}
|
||||
Logger(msg + path);
|
||||
|
||||
@@ -303,14 +303,14 @@ export function flattenObject(obj: Record<string | number | symbol, any>, path:
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function modifyFile(file: TFile, data: string | ArrayBuffer, options?: DataWriteOptions) {
|
||||
export function modifyFile(app: App, file: TFile, data: string | ArrayBuffer, options?: DataWriteOptions) {
|
||||
if (typeof (data) === "string") {
|
||||
return app.vault.modify(file, data, options);
|
||||
} else {
|
||||
return app.vault.modifyBinary(file, data, options);
|
||||
}
|
||||
}
|
||||
export function createFile(path: string, data: string | ArrayBuffer, options?: DataWriteOptions): Promise<TFile> {
|
||||
export function createFile(app: App, path: string, data: string | ArrayBuffer, options?: DataWriteOptions): Promise<TFile> {
|
||||
if (typeof (data) === "string") {
|
||||
return app.vault.create(path, data, options);
|
||||
} else {
|
||||
|
||||
@@ -6,6 +6,12 @@ It will be addressed soon. Please be patient if you are using filesystem-livesyn
|
||||
|
||||
|
||||
#### Version history
|
||||
- 0.21.1
|
||||
- Fixed:
|
||||
- No more infinity loops on larger files.
|
||||
- Show message on decode error.
|
||||
- Refactored:
|
||||
- Fixed to avoid obsolete global variables.
|
||||
- 0.21.0
|
||||
- Changes and performance improvements:
|
||||
- Now the saving files are processed by Blob.
|
||||
|
||||
Reference in New Issue
Block a user