1
0
mirror of https://github.com/vrtmrz/obsidian-livesync.git synced 2025-02-07 19:30:08 +02:00
- Hidden files are no longer handled in the initial replication.
  - Report from `Making report` fixed
This commit is contained in:
vorotamoroz 2023-09-20 07:04:31 +01:00
parent b9bd1f17b8
commit 23419e476a
2 changed files with 22 additions and 3 deletions

View File

@ -1508,10 +1508,12 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
pluginConfig.passphrase = REDACTED;
pluginConfig.encryptedPassphrase = REDACTED;
pluginConfig.encryptedCouchDBConnection = REDACTED;
pluginConfig.pluginSyncExtendedSetting = {};
const msgConfig = `----remote config----
${stringifyYaml(responseConfig)}
---- Plug-in config ---
version:${manifestVersion}
${stringifyYaml(pluginConfig)}`;
console.log(msgConfig);
await navigator.clipboard.writeText(msgConfig);

View File

@ -1415,10 +1415,10 @@ export default class ObsidianLiveSyncPlugin extends Plugin
const now = new Date().getTime();
if (queue.missingChildren.length == 0) {
queue.done = true;
if (isInternalMetadata(queue.entry._id)) {
if (isInternalMetadata(queue.entry._id) && this.settings.syncInternalFiles) {
//system file
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))) {
this.handleDBChanged(queue.entry);
} else {
@ -1460,7 +1460,14 @@ export default class ObsidianLiveSyncPlugin extends Plugin
if (!await this.isTargetFile(path)) return;
const skipOldFile = this.settings.skipOlderFilesOnSync && false; //patched temporary.
// 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
const ignoreFiles = [
"_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 (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 = {
entry: change,
missingChildren: [] as string[],
timeout: 0,
};
Logger(`Processing scheduled: ${change.path}`, LOG_LEVEL_INFO);
this.queuedFiles = this.queuedFiles.filter(e => e.entry.path != change.path);
this.queuedFiles.push(newQueue);
this.saveQueuedFiles();
continue;