mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-15 10:45:59 +00:00
### New Feature
- New chunking algorithm `V3: Fine deduplication` has been added, and will be recommended after updates. - New language `ko` (Korean) has been added. - Chinese (Simplified) translation has been updated. ### Fixed - Numeric settings are now never lost the focus during the value changing. ### Improved - All translations have rewritten into YAML format, to easier manage and contribution. - Doctor recommendations have now shown in the user-friendly notation. ### Refactored - Never ending `ObsidianLiveSyncSettingTag.ts` finally had separated into each pane's file. - Some commented-out codes have been removed.
This commit is contained in:
@@ -85,7 +85,8 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
name: getConfName(key as AllSettingItemKey),
|
||||
current: `${this.settings[key]}`,
|
||||
reason: value.reason ?? " N/A ",
|
||||
ideal: `${value.value}`,
|
||||
ideal: `${value.valueDisplay ?? value.value}`,
|
||||
//@ts-ignore
|
||||
level: `${level}`,
|
||||
note: note,
|
||||
}),
|
||||
@@ -147,157 +148,6 @@ export class ModuleMigration extends AbstractModule implements ICoreModule {
|
||||
await this.saveSettings();
|
||||
}
|
||||
}
|
||||
// async migrationCheck() {
|
||||
// const old = this.settings.settingVersion;
|
||||
// const current = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// // Check each migrations(old -> current)
|
||||
// if (!(await this.migrateToCaseInsensitive(old, current))) {
|
||||
// this._log(
|
||||
// $msg("moduleMigration.logMigrationFailed", {
|
||||
// old: old.toString(),
|
||||
// current: current.toString(),
|
||||
// }),
|
||||
// LOG_LEVEL_NOTICE
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// async migrateToCaseInsensitive(old: number, current: number) {
|
||||
// if (
|
||||
// this.settings.handleFilenameCaseSensitive !== undefined &&
|
||||
// this.settings.doNotUseFixedRevisionForChunks !== undefined
|
||||
// ) {
|
||||
// if (current < SETTING_VERSION_SUPPORT_CASE_INSENSITIVE) {
|
||||
// this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// await this.saveSettings();
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// if (
|
||||
// old >= SETTING_VERSION_SUPPORT_CASE_INSENSITIVE &&
|
||||
// this.settings.handleFilenameCaseSensitive !== undefined &&
|
||||
// this.settings.doNotUseFixedRevisionForChunks !== undefined
|
||||
// ) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// let remoteHandleFilenameCaseSensitive: undefined | boolean = undefined;
|
||||
// let remoteDoNotUseFixedRevisionForChunks: undefined | boolean = undefined;
|
||||
// let remoteChecked = false;
|
||||
// try {
|
||||
// const remoteInfo = await this.core.replicator.getRemotePreferredTweakValues(this.settings);
|
||||
// if (remoteInfo) {
|
||||
// remoteHandleFilenameCaseSensitive =
|
||||
// "handleFilenameCaseSensitive" in remoteInfo ? remoteInfo.handleFilenameCaseSensitive : false;
|
||||
// remoteDoNotUseFixedRevisionForChunks =
|
||||
// "doNotUseFixedRevisionForChunks" in remoteInfo ? remoteInfo.doNotUseFixedRevisionForChunks : false;
|
||||
// if (
|
||||
// remoteHandleFilenameCaseSensitive !== undefined ||
|
||||
// remoteDoNotUseFixedRevisionForChunks !== undefined
|
||||
// ) {
|
||||
// remoteChecked = true;
|
||||
// }
|
||||
// } else {
|
||||
// this._log($msg("moduleMigration.logFetchRemoteTweakFailed"), LOG_LEVEL_INFO);
|
||||
// }
|
||||
// } catch (ex) {
|
||||
// this._log($msg("moduleMigration.logRemoteTweakUnavailable"), LOG_LEVEL_INFO);
|
||||
// this._log(ex, LOG_LEVEL_VERBOSE);
|
||||
// }
|
||||
|
||||
// if (remoteChecked) {
|
||||
// // The case that the remote could be checked.
|
||||
// if (remoteHandleFilenameCaseSensitive && remoteDoNotUseFixedRevisionForChunks) {
|
||||
// // Migrated, but configured as same as old behaviour.
|
||||
// this.settings.handleFilenameCaseSensitive = true;
|
||||
// this.settings.doNotUseFixedRevisionForChunks = true;
|
||||
// this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// this._log(
|
||||
// $msg("moduleMigration.logMigratedSameBehaviour", {
|
||||
// current: current.toString(),
|
||||
// }),
|
||||
// LOG_LEVEL_INFO
|
||||
// );
|
||||
// await this.saveSettings();
|
||||
// return true;
|
||||
// }
|
||||
// const message = $msg("moduleMigration.msgFetchRemoteAgain");
|
||||
// const OPTION_FETCH = $msg("moduleMigration.optionYesFetchAgain");
|
||||
// const DISMISS = $msg("moduleMigration.optionNoAskAgain");
|
||||
// const options = [OPTION_FETCH, DISMISS];
|
||||
// const ret = await this.core.confirm.confirmWithMessage(
|
||||
// $msg("moduleMigration.titleCaseSensitivity"),
|
||||
// message,
|
||||
// options,
|
||||
// DISMISS,
|
||||
// 40
|
||||
// );
|
||||
// if (ret == OPTION_FETCH) {
|
||||
// this.settings.handleFilenameCaseSensitive = remoteHandleFilenameCaseSensitive || false;
|
||||
// this.settings.doNotUseFixedRevisionForChunks = remoteDoNotUseFixedRevisionForChunks || false;
|
||||
// this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// await this.saveSettings();
|
||||
// try {
|
||||
// await this.core.rebuilder.scheduleFetch();
|
||||
// return;
|
||||
// } catch (ex) {
|
||||
// this._log($msg("moduleMigration.logRedflag2CreationFail"), LOG_LEVEL_VERBOSE);
|
||||
// this._log(ex, LOG_LEVEL_VERBOSE);
|
||||
// }
|
||||
// return false;
|
||||
// } else {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// const ENABLE_BOTH = $msg("moduleMigration.optionEnableBoth");
|
||||
// const ENABLE_FILENAME_CASE_INSENSITIVE = $msg("moduleMigration.optionEnableFilenameCaseInsensitive");
|
||||
// const ENABLE_FIXED_REVISION_FOR_CHUNKS = $msg("moduleMigration.optionEnableFixedRevisionForChunks");
|
||||
// const ADJUST_TO_REMOTE = $msg("moduleMigration.optionAdjustRemote");
|
||||
// const KEEP = $msg("moduleMigration.optionKeepPreviousBehaviour");
|
||||
// const DISMISS = $msg("moduleMigration.optionDecideLater");
|
||||
// const message = $msg("moduleMigration.msgSinceV02321");
|
||||
// const options = [ENABLE_BOTH, ENABLE_FILENAME_CASE_INSENSITIVE, ENABLE_FIXED_REVISION_FOR_CHUNKS];
|
||||
// if (remoteChecked) {
|
||||
// options.push(ADJUST_TO_REMOTE);
|
||||
// }
|
||||
// options.push(KEEP, DISMISS);
|
||||
// const ret = await this.core.confirm.confirmWithMessage(
|
||||
// $msg("moduleMigration.titleCaseSensitivity"),
|
||||
// message,
|
||||
// options,
|
||||
// DISMISS,
|
||||
// 40
|
||||
// );
|
||||
// console.dir(ret);
|
||||
// switch (ret) {
|
||||
// case ENABLE_BOTH:
|
||||
// this.settings.handleFilenameCaseSensitive = false;
|
||||
// this.settings.doNotUseFixedRevisionForChunks = false;
|
||||
// break;
|
||||
// case ENABLE_FILENAME_CASE_INSENSITIVE:
|
||||
// this.settings.handleFilenameCaseSensitive = false;
|
||||
// this.settings.doNotUseFixedRevisionForChunks = true;
|
||||
// break;
|
||||
// case ENABLE_FIXED_REVISION_FOR_CHUNKS:
|
||||
// this.settings.doNotUseFixedRevisionForChunks = false;
|
||||
// this.settings.handleFilenameCaseSensitive = true;
|
||||
// break;
|
||||
// case KEEP:
|
||||
// this.settings.handleFilenameCaseSensitive = true;
|
||||
// this.settings.doNotUseFixedRevisionForChunks = true;
|
||||
// this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// await this.saveSettings();
|
||||
// return true;
|
||||
// case DISMISS:
|
||||
// default:
|
||||
// return false;
|
||||
// }
|
||||
// this.settings.settingVersion = SETTING_VERSION_SUPPORT_CASE_INSENSITIVE;
|
||||
// await this.saveSettings();
|
||||
// await this.core.rebuilder.scheduleRebuild();
|
||||
// await this.core.$$performRestart();
|
||||
// }
|
||||
|
||||
async initialMessage() {
|
||||
const message = $msg("moduleMigration.msgInitialSetup", {
|
||||
|
||||
Reference in New Issue
Block a user