mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-03-03 15:32:25 +02:00
Fixed:
- Now reading error will be reported.
This commit is contained in:
parent
a0efda9e71
commit
8f2ae437c6
2
src/lib
2
src/lib
@ -1 +1 @@
|
||||
Subproject commit e4d825ae13e4a591be0598cf9661ee0651f0a58c
|
||||
Subproject commit fbb3fcd8b479035b82e5ffeb3a68ade51a4c28b7
|
22
src/main.ts
22
src/main.ts
@ -2714,7 +2714,13 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
||||
Logger(`Reading : ${file.path}`, LOG_LEVEL.VERBOSE);
|
||||
const contentBin = await this.app.vault.readBinary(file);
|
||||
Logger(`Processing: ${file.path}`, LOG_LEVEL.VERBOSE);
|
||||
try {
|
||||
content = await arrayBufferToBase64(contentBin);
|
||||
} catch (ex) {
|
||||
Logger(`The file ${file.path} could not be encoded`);
|
||||
Logger(ex, LOG_LEVEL.VERBOSE);
|
||||
return false;
|
||||
}
|
||||
datatype = "newnote";
|
||||
} else {
|
||||
content = await this.app.vault.read(file);
|
||||
@ -2722,7 +2728,14 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
||||
}
|
||||
} else {
|
||||
if (cache instanceof ArrayBuffer) {
|
||||
Logger(`Processing: ${file.path}`, LOG_LEVEL.VERBOSE);
|
||||
try {
|
||||
content = await arrayBufferToBase64(cache);
|
||||
} catch (ex) {
|
||||
Logger(`The file ${file.path} could not be encoded`);
|
||||
Logger(ex, LOG_LEVEL.VERBOSE);
|
||||
return false;
|
||||
}
|
||||
datatype = "newnote"
|
||||
} else {
|
||||
content = cache;
|
||||
@ -3071,7 +3084,14 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
|
||||
async storeInternalFileToDatabase(file: InternalFileInfo, forceWrite = false) {
|
||||
const id = filename2idInternalMetadata(path2id(file.path));
|
||||
const contentBin = await this.app.vault.adapter.readBinary(file.path);
|
||||
const content = await arrayBufferToBase64(contentBin);
|
||||
let content: string[];
|
||||
try {
|
||||
content = await arrayBufferToBase64(contentBin);
|
||||
} catch (ex) {
|
||||
Logger(`The file ${file.path} could not be encoded`);
|
||||
Logger(ex, LOG_LEVEL.VERBOSE);
|
||||
return false;
|
||||
}
|
||||
const mtime = file.mtime;
|
||||
return await runWithLock("file-" + id, false, async () => {
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user