mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-24 07:03:55 +00:00
WIP (pluginV2)
This commit is contained in:
@@ -1512,11 +1512,13 @@ export class ConfigSync extends LiveSyncCommands {
|
||||
if (stat && stat.type != "file") return false;
|
||||
|
||||
const configDir = normalizePath(this.configDir);
|
||||
const synchronisedInConfigSync = Object.values(this.settings.pluginSyncExtendedSetting)
|
||||
.filter((e) => e.mode != MODE_SELECTIVE && e.mode != MODE_SHINY)
|
||||
.map((e) => e.files)
|
||||
.flat()
|
||||
.map((e) => `${configDir}/${e}`.toLowerCase());
|
||||
const synchronisedInConfigSync = this.useV2
|
||||
? []
|
||||
: Object.values(this.settings.pluginSyncExtendedSetting)
|
||||
.filter((e) => e.mode != MODE_SELECTIVE && e.mode != MODE_SHINY)
|
||||
.map((e) => e.files)
|
||||
.flat()
|
||||
.map((e) => `${configDir}/${e}`.toLowerCase());
|
||||
if (synchronisedInConfigSync.some((e) => e.startsWith(path.toLowerCase()))) {
|
||||
this._log(`Customization file skipped: ${path}`, LOG_LEVEL_VERBOSE);
|
||||
// This file could be handled by the other module.
|
||||
|
||||
@@ -971,7 +971,8 @@ Offline Changed files: ${processFiles.length}`;
|
||||
getCustomisationSynchronizationIgnoredFiles(): string[] {
|
||||
const configDir = this.services.API.getSystemConfigDir();
|
||||
const key =
|
||||
JSON.stringify(this.settings.pluginSyncExtendedSetting) + `||${this.settings.usePluginSync}||${configDir}`;
|
||||
JSON.stringify(this.settings.pluginSyncExtendedSetting) +
|
||||
`||${this.settings.usePluginSync}||${this.settings.usePluginSyncV2}||${configDir}`;
|
||||
if (this.cacheCustomisationSyncIgnoredFiles.has(key)) {
|
||||
return this.cacheCustomisationSyncIgnoredFiles.get(key)!;
|
||||
}
|
||||
@@ -983,6 +984,13 @@ Offline Changed files: ${processFiles.length}`;
|
||||
.map((e) => e.files)
|
||||
.flat()
|
||||
.map((e) => `${configDir}/${e}`.toLowerCase());
|
||||
|
||||
if (this.settings.usePluginSyncV2) {
|
||||
synchronisedInConfigSync.push(`${configDir}/plugins/`.toLowerCase());
|
||||
synchronisedInConfigSync.push(`${configDir}/themes/`.toLowerCase());
|
||||
synchronisedInConfigSync.push(`${configDir}/snippets/`.toLowerCase());
|
||||
}
|
||||
|
||||
this.cacheCustomisationSyncIgnoredFiles.set(key, synchronisedInConfigSync);
|
||||
return synchronisedInConfigSync;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user