mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-21 13:41:29 +00:00
- Fixed:
- Hidden files are no longer handled in the initial replication. - Report from `Making report` fixed
This commit is contained in:
@@ -1508,10 +1508,12 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
|
|||||||
pluginConfig.passphrase = REDACTED;
|
pluginConfig.passphrase = REDACTED;
|
||||||
pluginConfig.encryptedPassphrase = REDACTED;
|
pluginConfig.encryptedPassphrase = REDACTED;
|
||||||
pluginConfig.encryptedCouchDBConnection = REDACTED;
|
pluginConfig.encryptedCouchDBConnection = REDACTED;
|
||||||
|
pluginConfig.pluginSyncExtendedSetting = {};
|
||||||
|
|
||||||
const msgConfig = `----remote config----
|
const msgConfig = `----remote config----
|
||||||
${stringifyYaml(responseConfig)}
|
${stringifyYaml(responseConfig)}
|
||||||
---- Plug-in config ---
|
---- Plug-in config ---
|
||||||
|
version:${manifestVersion}
|
||||||
${stringifyYaml(pluginConfig)}`;
|
${stringifyYaml(pluginConfig)}`;
|
||||||
console.log(msgConfig);
|
console.log(msgConfig);
|
||||||
await navigator.clipboard.writeText(msgConfig);
|
await navigator.clipboard.writeText(msgConfig);
|
||||||
|
|||||||
23
src/main.ts
23
src/main.ts
@@ -1415,10 +1415,10 @@ export default class ObsidianLiveSyncPlugin extends Plugin
|
|||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
if (queue.missingChildren.length == 0) {
|
if (queue.missingChildren.length == 0) {
|
||||||
queue.done = true;
|
queue.done = true;
|
||||||
if (isInternalMetadata(queue.entry._id)) {
|
if (isInternalMetadata(queue.entry._id) && this.settings.syncInternalFiles) {
|
||||||
//system file
|
//system file
|
||||||
const filename = this.getPathWithoutPrefix(queue.entry);
|
const filename = this.getPathWithoutPrefix(queue.entry);
|
||||||
this.addOnHiddenFileSync.procInternalFile(filename);
|
this.isTargetFile(filename).then((ret) => ret ? this.addOnHiddenFileSync.procInternalFile(filename) : Logger(`Skipped (Not target:${filename})`, LOG_LEVEL_VERBOSE));
|
||||||
} else if (isValidPath(this.getPath(queue.entry))) {
|
} else if (isValidPath(this.getPath(queue.entry))) {
|
||||||
this.handleDBChanged(queue.entry);
|
this.handleDBChanged(queue.entry);
|
||||||
} else {
|
} else {
|
||||||
@@ -1460,7 +1460,14 @@ export default class ObsidianLiveSyncPlugin extends Plugin
|
|||||||
if (!await this.isTargetFile(path)) return;
|
if (!await this.isTargetFile(path)) return;
|
||||||
const skipOldFile = this.settings.skipOlderFilesOnSync && false; //patched temporary.
|
const skipOldFile = this.settings.skipOlderFilesOnSync && false; //patched temporary.
|
||||||
// Do not handle internal files if the feature has not been enabled.
|
// Do not handle internal files if the feature has not been enabled.
|
||||||
if (isInternalMetadata(doc._id) && !this.settings.syncInternalFiles) return;
|
if (isInternalMetadata(doc._id) && !this.settings.syncInternalFiles) {
|
||||||
|
Logger(`Skipped: ${path} (${doc._id}, ${doc._rev}) Hidden file sync is disabled.`, LOG_LEVEL_VERBOSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (isCustomisationSyncMetadata(doc._id) && !this.settings.usePluginSync) {
|
||||||
|
Logger(`Skipped: ${path} (${doc._id}, ${doc._rev}) Customization sync is disabled.`, LOG_LEVEL_VERBOSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
// It is better for your own safety, not to handle the following files
|
// It is better for your own safety, not to handle the following files
|
||||||
const ignoreFiles = [
|
const ignoreFiles = [
|
||||||
"_design/replicate",
|
"_design/replicate",
|
||||||
@@ -1534,12 +1541,22 @@ export default class ObsidianLiveSyncPlugin extends Plugin
|
|||||||
|
|
||||||
if (change.type != "leaf" && change.type != "versioninfo" && change.type != "milestoneinfo" && change.type != "nodeinfo") {
|
if (change.type != "leaf" && change.type != "versioninfo" && change.type != "milestoneinfo" && change.type != "nodeinfo") {
|
||||||
if (this.settings.suspendParseReplicationResult) {
|
if (this.settings.suspendParseReplicationResult) {
|
||||||
|
if (isInternalMetadata(change._id) && !this.settings.syncInternalFiles) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (isCustomisationSyncMetadata(change._id) && !this.settings.usePluginSync) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!change.path) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const newQueue = {
|
const newQueue = {
|
||||||
entry: change,
|
entry: change,
|
||||||
missingChildren: [] as string[],
|
missingChildren: [] as string[],
|
||||||
timeout: 0,
|
timeout: 0,
|
||||||
};
|
};
|
||||||
Logger(`Processing scheduled: ${change.path}`, LOG_LEVEL_INFO);
|
Logger(`Processing scheduled: ${change.path}`, LOG_LEVEL_INFO);
|
||||||
|
this.queuedFiles = this.queuedFiles.filter(e => e.entry.path != change.path);
|
||||||
this.queuedFiles.push(newQueue);
|
this.queuedFiles.push(newQueue);
|
||||||
this.saveQueuedFiles();
|
this.saveQueuedFiles();
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user