mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-05 01:28:46 +08:00
add function: sync personal movie/book/music info
This commit is contained in:
parent
01a066f393
commit
80873784fc
@ -97,6 +97,14 @@ export const DoubanSubjectStateRecords_NOTE_SYNC: { [key :string]: string } = {
|
|||||||
[ALL]: i18nHelper.getMessage('500004'),
|
[ALL]: i18nHelper.getMessage('500004'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
export const DoubanSubjectStateRecords_MUSIC_SYNC: { [key in DoubanSubjectState]: string } = {
|
||||||
|
// @ts-ignore
|
||||||
|
[ALL]: i18nHelper.getMessage('500004'),
|
||||||
|
[DoubanSubjectState.wish]: i18nHelper.getMessage('500402'),
|
||||||
|
[DoubanSubjectState.do]: i18nHelper.getMessage('500403'),
|
||||||
|
[DoubanSubjectState.collect]: i18nHelper.getMessage('500404'),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import {
|
|||||||
ButtonComponent,
|
ButtonComponent,
|
||||||
DropdownComponent,
|
DropdownComponent,
|
||||||
Modal, SearchComponent, Setting,
|
Modal, SearchComponent, Setting,
|
||||||
|
TextComponent,
|
||||||
ToggleComponent
|
ToggleComponent
|
||||||
} from "obsidian";
|
} from "obsidian";
|
||||||
|
|
||||||
@ -13,13 +14,15 @@ import {SyncType, SyncTypeRecords} from "../../constant/Constsant";
|
|||||||
import {
|
import {
|
||||||
ALL,
|
ALL,
|
||||||
DoubanSubjectStateRecords_BOOK_SYNC, DoubanSubjectStateRecords_BROADCAST_SYNC,
|
DoubanSubjectStateRecords_BOOK_SYNC, DoubanSubjectStateRecords_BROADCAST_SYNC,
|
||||||
DoubanSubjectStateRecords_MOVIE_SYNC, DoubanSubjectStateRecords_NOTE_SYNC
|
DoubanSubjectStateRecords_MOVIE_SYNC, DoubanSubjectStateRecords_MUSIC_SYNC, DoubanSubjectStateRecords_NOTE_SYNC
|
||||||
} from "../../constant/DoubanUserState";
|
} from "../../constant/DoubanUserState";
|
||||||
import {SyncConfig} from "../sync/model/SyncConfig";
|
import {SyncConfig} from "../sync/model/SyncConfig";
|
||||||
import {clearInterval} from "timers";
|
import {clearInterval} from "timers";
|
||||||
import {statSync} from "fs";
|
import {statSync} from "fs";
|
||||||
import {CreateTemplateSelectParams} from "../setting/model/CreateTemplateSelectParams";
|
import {CreateTemplateSelectParams} from "../setting/model/CreateTemplateSelectParams";
|
||||||
import {FolderSuggest} from "../setting/model/FolderSuggest";
|
import {FolderSuggest} from "../setting/model/FolderSuggest";
|
||||||
|
import SettingsManager from "../setting/SettingsManager";
|
||||||
|
import {DEFAULT_SETTINGS} from "../../constant/DefaultSettings";
|
||||||
|
|
||||||
export class DoubanSyncModal extends Modal {
|
export class DoubanSyncModal extends Modal {
|
||||||
plugin: DoubanPlugin;
|
plugin: DoubanPlugin;
|
||||||
@ -55,7 +58,6 @@ export class DoubanSyncModal extends Modal {
|
|||||||
|
|
||||||
const sliderDiv = contentEl.createEl('div');
|
const sliderDiv = contentEl.createEl('div');
|
||||||
sliderDiv.addClass('obsidian_douban_sync_slider');
|
sliderDiv.addClass('obsidian_douban_sync_slider');
|
||||||
this.showProgress(sliderDiv);
|
|
||||||
const controls = contentEl.createDiv("controls");
|
const controls = contentEl.createDiv("controls");
|
||||||
|
|
||||||
const syncButton = new ButtonComponent(controls)
|
const syncButton = new ButtonComponent(controls)
|
||||||
@ -72,16 +74,22 @@ export class DoubanSyncModal extends Modal {
|
|||||||
});
|
});
|
||||||
cancelButton.setClass("obsidian_douban_search_button");
|
cancelButton.setClass("obsidian_douban_search_button");
|
||||||
syncButton.setClass("obsidian_douban_search_button");
|
syncButton.setClass("obsidian_douban_search_button");
|
||||||
|
this.showProgress(sliderDiv, syncButton);
|
||||||
|
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
this.showProgress(sliderDiv);
|
this.showProgress(sliderDiv,syncButton);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private showProgress(sliderDiv: HTMLDivElement) {
|
private showProgress(sliderDiv: HTMLDivElement, button:ButtonComponent) {
|
||||||
const {syncStatus} = this.plugin.statusHolder;
|
const {syncStatus} = this.plugin.statusHolder;
|
||||||
if (!syncStatus) {
|
if (!this.plugin.statusHolder.syncStarted) {
|
||||||
|
sliderDiv.innerHTML = `<p>
|
||||||
|
<label for="file">${i18nHelper.getMessage('110033')}</label>
|
||||||
|
<progress class="obsidian_douban_sync_slider" max="${syncStatus.getTotal()}" value="${syncStatus.getHandle()}"> </progress> <span> ${syncStatus.getHandle()}/${syncStatus.getTotal()}:${i18nHelper.getMessage('110036')} </span>
|
||||||
|
</p>`
|
||||||
|
button.setDisabled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sliderDiv.innerHTML = `<p>
|
sliderDiv.innerHTML = `<p>
|
||||||
@ -94,8 +102,11 @@ export class DoubanSyncModal extends Modal {
|
|||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
}
|
}
|
||||||
contentEl.createEl("h3", {text: i18nHelper.getMessage('500001')});
|
contentEl.createEl("h3", {text: i18nHelper.getMessage('500001')});
|
||||||
|
const {settings} = this.plugin;
|
||||||
let syncConfig:SyncConfig = {syncType: SyncType.movie, scope: ALL, force: false, outputFolder: this.plugin.settings.dataFilePath};
|
let syncConfig:SyncConfig = {syncType: SyncType.movie, scope: ALL,
|
||||||
|
force: false,
|
||||||
|
outputFolder: (settings.dataFilePath == '' || settings.dataFilePath == null) ? DEFAULT_SETTINGS.dataFilePath : settings.dataFilePath,
|
||||||
|
dataFileNamePath: (settings.dataFileNamePath == '' || settings.dataFileNamePath == null) ? DEFAULT_SETTINGS.dataFileNamePath : settings.dataFileNamePath};
|
||||||
this.showConfigPan(contentEl, syncConfig, false);
|
this.showConfigPan(contentEl, syncConfig, false);
|
||||||
const controls = contentEl.createDiv("controls");
|
const controls = contentEl.createDiv("controls");
|
||||||
|
|
||||||
@ -157,6 +168,16 @@ export class DoubanSyncModal extends Modal {
|
|||||||
folderLabel.addClass('obsidian_douban_sync_config_text');
|
folderLabel.addClass('obsidian_douban_sync_config_text');
|
||||||
this.createFolderSetting(folderSelections, config, disable);
|
this.createFolderSetting(folderSelections, config, disable);
|
||||||
|
|
||||||
|
const fileName = contentEl.createDiv('fileName-item');
|
||||||
|
let fileNameLabel = fileName.createEl('label');
|
||||||
|
fileNameLabel.setText(i18nHelper.getMessage('110035'));
|
||||||
|
fileNameLabel.addClass('obsidian_douban_settings_text');
|
||||||
|
fileNameLabel.addClass('obsidian_douban_sync_config_text');
|
||||||
|
fileNameLabel.addClass('obsidian_douban_sync_config');
|
||||||
|
this.constructOutiFleName(fileName, config, disable);
|
||||||
|
|
||||||
|
fileName.addClass('obsidian_douban_sync_config');
|
||||||
|
folderSelections.addClass('obsidian_douban_sync_config');
|
||||||
typeSelections.addClass('obsidian_douban_sync_config');
|
typeSelections.addClass('obsidian_douban_sync_config');
|
||||||
scopeSelections.addClass('obsidian_douban_sync_config');
|
scopeSelections.addClass('obsidian_douban_sync_config');
|
||||||
forceSelections.addClass('obsidian_douban_sync_config');
|
forceSelections.addClass('obsidian_douban_sync_config');
|
||||||
@ -188,6 +209,9 @@ export class DoubanSyncModal extends Modal {
|
|||||||
case SyncType.note:
|
case SyncType.note:
|
||||||
this.showScopeDropdown(contentEl, DoubanSubjectStateRecords_NOTE_SYNC, config, disable);
|
this.showScopeDropdown(contentEl, DoubanSubjectStateRecords_NOTE_SYNC, config, disable);
|
||||||
break;
|
break;
|
||||||
|
case SyncType.music:
|
||||||
|
this.showScopeDropdown(contentEl, DoubanSubjectStateRecords_MUSIC_SYNC, config, disable);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,14 +228,16 @@ export class DoubanSyncModal extends Modal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createFolderSetting(contentEl:HTMLDivElement, config: SyncConfig, disable:boolean) {
|
private createFolderSetting(contentEl:HTMLDivElement, config: SyncConfig, disable:boolean) {
|
||||||
let outputFolder = this.plugin.settings.dataFilePath;
|
const {settings} = this.plugin;
|
||||||
|
const placeHolder = (settings.dataFilePath == '' || settings.dataFilePath == null) ? DEFAULT_SETTINGS.dataFilePath : settings.dataFilePath;
|
||||||
|
let outputFolder = placeHolder;
|
||||||
if (config.outputFolder) {
|
if (config.outputFolder) {
|
||||||
outputFolder = config.outputFolder;
|
outputFolder = config.outputFolder;
|
||||||
}
|
}
|
||||||
const search = new SearchComponent(contentEl);
|
const search = new TextComponent(contentEl);
|
||||||
new FolderSuggest(this.plugin.app, search.inputEl);
|
new FolderSuggest(this.plugin.app, search.inputEl);
|
||||||
search.setValue(outputFolder)
|
search.setValue(outputFolder)
|
||||||
.setPlaceholder(i18nHelper.getMessage('121503'))
|
.setPlaceholder(placeHolder)
|
||||||
.onChange(async (value:string) => {
|
.onChange(async (value:string) => {
|
||||||
config.outputFolder = value;
|
config.outputFolder = value;
|
||||||
})
|
})
|
||||||
@ -220,4 +246,22 @@ export class DoubanSyncModal extends Modal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private constructOutiFleName(containerEl: HTMLElement, config: SyncConfig, disable:boolean) {
|
||||||
|
const {settings} = this.plugin;
|
||||||
|
const placeHolder =(settings.dataFileNamePath == '' || settings.dataFileNamePath == null) ? DEFAULT_SETTINGS.dataFileNamePath : settings.dataFileNamePath;
|
||||||
|
let dataFileNamePath = placeHolder;
|
||||||
|
if (config.dataFileNamePath) {
|
||||||
|
dataFileNamePath = config.dataFileNamePath;
|
||||||
|
}
|
||||||
|
const textComponent = new TextComponent(containerEl);
|
||||||
|
textComponent.setPlaceholder(placeHolder)
|
||||||
|
.setValue(dataFileNamePath)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
config.dataFileNamePath = value;
|
||||||
|
});
|
||||||
|
if (disable) {
|
||||||
|
textComponent.setDisabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,6 +68,9 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getFileName(context: HandleContext): string {
|
private getFileName(context: HandleContext): string {
|
||||||
|
if (context.dataFileNamePath) {
|
||||||
|
return context.dataFileNamePath;
|
||||||
|
}
|
||||||
const {dataFileNamePath} = context.settings;
|
const {dataFileNamePath} = context.settings;
|
||||||
return dataFileNamePath ? dataFileNamePath : DEFAULT_SETTINGS.dataFileNamePath;
|
return dataFileNamePath ? dataFileNamePath : DEFAULT_SETTINGS.dataFileNamePath;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,5 +16,6 @@ export default interface HandleContext {
|
|||||||
showAfterCreate?:boolean;
|
showAfterCreate?:boolean;
|
||||||
syncStatusHolder?:SyncStatusHolder;
|
syncStatusHolder?:SyncStatusHolder;
|
||||||
action:string;
|
action:string;
|
||||||
outputFolder:string;
|
outputFolder?:string;
|
||||||
|
dataFileNamePath?:string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,27 +7,32 @@ import {DoubanSubjectState} from "../../constant/DoubanUserState";
|
|||||||
|
|
||||||
export default class GlobalStatusHolder {
|
export default class GlobalStatusHolder {
|
||||||
public syncStatus:GlobalSyncStatusHolder;
|
public syncStatus:GlobalSyncStatusHolder;
|
||||||
|
public syncStarted:boolean;
|
||||||
|
public syncStartTime:number;
|
||||||
|
|
||||||
public completeSync() {
|
public completeSync() {
|
||||||
this.syncStatus = null;
|
this.syncStarted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public startSync(syncConfigOut: SyncConfig):boolean {
|
public startSync(syncConfigOut: SyncConfig):boolean {
|
||||||
if (this.syncStatus) {
|
if (this.syncStarted) {
|
||||||
const {syncConfig} = this.syncStatus;
|
const {syncConfig} = this.syncStatus;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
new Notice(i18nHelper.getMessage('110008'), SyncTypeRecords[syncConfig.syncType], DoubanSubjectState[syncConfig.scope]);
|
new Notice(i18nHelper.getMessage('110008'), SyncTypeRecords[syncConfig.syncType], DoubanSubjectState[syncConfig.scope]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.syncStatus = new GlobalSyncStatusHolder(syncConfigOut);
|
this.syncStatus = new GlobalSyncStatusHolder(syncConfigOut);
|
||||||
|
this.syncStarted = true;
|
||||||
|
this.syncStartTime = new Date().getTime();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public stopSync() {
|
public stopSync() {
|
||||||
this.syncStatus = null;
|
this.syncStarted = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public syncing() {
|
public syncing() {
|
||||||
return this.syncStatus;
|
return this.syncStarted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,13 +5,11 @@ export default class GlobalSyncStatusHolder {
|
|||||||
public syncConfig: SyncConfig;
|
public syncConfig: SyncConfig;
|
||||||
private total:number;
|
private total:number;
|
||||||
private handle:number;
|
private handle:number;
|
||||||
private startTime:number;
|
|
||||||
|
|
||||||
constructor(syncConfig: SyncConfig) {
|
constructor(syncConfig: SyncConfig) {
|
||||||
this.syncConfig = syncConfig;
|
this.syncConfig = syncConfig;
|
||||||
this.startTime = new Date().getTime();
|
this.total = 100;
|
||||||
this.total = 0;
|
this.handle = 1;
|
||||||
this.handle = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handled(num:number) {
|
handled(num:number) {
|
||||||
|
|||||||
@ -3,4 +3,5 @@ export interface SyncConfig {
|
|||||||
scope: string,
|
scope: string,
|
||||||
force:boolean,
|
force:boolean,
|
||||||
outputFolder:string;
|
outputFolder:string;
|
||||||
|
dataFileNamePath:string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,8 @@ export default {
|
|||||||
'110032': `Scope:`,
|
'110032': `Scope:`,
|
||||||
'110033': `Progress:`,
|
'110033': `Progress:`,
|
||||||
'110034': `OutputFolder:`,
|
'110034': `OutputFolder:`,
|
||||||
|
'110035': `FileName: (Tip:Support Variables And Path)`,
|
||||||
|
'110036': `Complete`,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -183,7 +185,7 @@ export default {
|
|||||||
'140207': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140207': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
|
|
||||||
'140301': `Douban: Syncing...`,
|
'140301': `Douban: Syncing[{0}]...`,
|
||||||
'140303': `Douban: User Info Expire, Please login again`,
|
'140303': `Douban: User Info Expire, Please login again`,
|
||||||
'140302': `Douban: Sync complete`,
|
'140302': `Douban: Sync complete`,
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,8 @@ export default {
|
|||||||
'110032': `范围:`,
|
'110032': `范围:`,
|
||||||
'110033': `进度:`,
|
'110033': `进度:`,
|
||||||
'110034': `输出文件夹:`,
|
'110034': `输出文件夹:`,
|
||||||
|
'110035': `文档名: (提示:支持参数化以及多级路径, 可用参数见配置界面)`,
|
||||||
|
'110036': `完成`,
|
||||||
|
|
||||||
|
|
||||||
'110201': `{0} 文件已经存在.`,
|
'110201': `{0} 文件已经存在.`,
|
||||||
@ -189,7 +191,7 @@ export default {
|
|||||||
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
'140208': `[OB-Douban]: [{0}/{1}] {2}`,
|
||||||
|
|
||||||
|
|
||||||
'140301': `Douban: 开始同步...`,
|
'140301': `Douban: 开始同步[{0}]...`,
|
||||||
'140302': `Douban: 同步完成`,
|
'140302': `Douban: 同步完成`,
|
||||||
'140303': `Douban: 用户信息已过期,请至插件中重新登录`,
|
'140303': `Douban: 用户信息已过期,请至插件中重新登录`,
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import DoubanSubject from "./douban/data/model/DoubanSubject";
|
|||||||
import Searcher from "./douban/data/search/Search";
|
import Searcher from "./douban/data/search/Search";
|
||||||
import {i18nHelper} from './lang/helper';
|
import {i18nHelper} from './lang/helper';
|
||||||
import {log} from "src/org/wanxp/utils/Logutil";
|
import {log} from "src/org/wanxp/utils/Logutil";
|
||||||
import {Action, BasicConst, SearchHandleMode} from "./constant/Constsant";
|
import {Action, BasicConst, SearchHandleMode, SyncTypeRecords} from "./constant/Constsant";
|
||||||
import FileHandler from "./file/FileHandler";
|
import FileHandler from "./file/FileHandler";
|
||||||
import HandleContext from "./douban/data/model/HandleContext";
|
import HandleContext from "./douban/data/model/HandleContext";
|
||||||
import HandleResult from "./douban/data/model/HandleResult";
|
import HandleResult from "./douban/data/model/HandleResult";
|
||||||
@ -83,24 +83,28 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
|
|
||||||
async createFile(context: HandleContext, result: HandleResult) {
|
async createFile(context: HandleContext, result: HandleResult) {
|
||||||
let filePath = this.settings.dataFilePath;
|
let filePath = this.settings.dataFilePath;
|
||||||
|
if (context.outputFolder) {
|
||||||
|
filePath = context.outputFolder;
|
||||||
|
}
|
||||||
filePath = filePath?filePath:DEFAULT_SETTINGS.dataFilePath;
|
filePath = filePath?filePath:DEFAULT_SETTINGS.dataFilePath;
|
||||||
filePath = FileUtil.join(filePath, result.fileName);
|
filePath = FileUtil.join(filePath, result.fileName);
|
||||||
const {syncStatusHolder} = context;
|
const {syncStatusHolder} = context;
|
||||||
const {subject} = result;
|
const {subject} = result;
|
||||||
|
const {content} = result;
|
||||||
if (Action.Sync == context.action) {
|
if (Action.Sync == context.action) {
|
||||||
if (context.syncStatusHolder.syncConfig.force) {
|
if (context.syncStatusHolder.syncConfig.force) {
|
||||||
const exists:boolean = await this.fileHandler.createOrReplaceNewNoteWithData(filePath, result.content, context.showAfterCreate);
|
const exists:boolean = await this.fileHandler.createOrReplaceNewNoteWithData(filePath, content, context.showAfterCreate);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
syncStatusHolder != null ? syncStatusHolder.replace(subject.id, subject.title):null;
|
syncStatusHolder != null ? syncStatusHolder.replace(subject.id, subject.title):null;
|
||||||
}else {
|
}else {
|
||||||
syncStatusHolder != null ?syncStatusHolder.create(subject.id, subject.title):null;
|
syncStatusHolder != null ?syncStatusHolder.create(subject.id, subject.title):null;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
await this.fileHandler.createNewNoteWithData(filePath, result.content, context.showAfterCreate);
|
await this.fileHandler.createNewNoteWithData(filePath, content, context.showAfterCreate);
|
||||||
syncStatusHolder != null ?syncStatusHolder.create(subject.id, subject.title):null;
|
syncStatusHolder != null ?syncStatusHolder.create(subject.id, subject.title):null;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
await this.fileHandler.createNewNoteWithData(filePath, result.content, context.showAfterCreate);
|
await this.fileHandler.createNewNoteWithData(filePath, content, context.showAfterCreate);
|
||||||
syncStatusHolder != null ?syncStatusHolder.create(subject.id, subject.title):null;
|
syncStatusHolder != null ?syncStatusHolder.create(subject.id, subject.title):null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -243,15 +247,23 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (syncConfig.dataFileNamePath) {
|
||||||
|
context.dataFileNamePath = syncConfig.dataFileNamePath;
|
||||||
|
}
|
||||||
|
if (syncConfig.outputFolder) {
|
||||||
|
context.outputFolder = syncConfig.outputFolder;
|
||||||
|
}
|
||||||
context.syncStatusHolder = new SyncStatusHolder(syncConfig, this.statusHolder);
|
context.syncStatusHolder = new SyncStatusHolder(syncConfig, this.statusHolder);
|
||||||
new Notice(i18nHelper.getMessage('140301'));
|
// @ts-ignore
|
||||||
this.showStatus(i18nHelper.getMessage('140203', syncConfig.syncType));
|
new Notice(i18nHelper.getMessage('140301', SyncTypeRecords[syncConfig.syncType]));
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
this.showStatus(i18nHelper.getMessage('140203', SyncTypeRecords[syncConfig.syncType]));
|
||||||
const syncHandler = new SyncHandler(this.app, this, syncConfig, context);
|
const syncHandler = new SyncHandler(this.app, this, syncConfig, context);
|
||||||
await syncHandler.sync();
|
await syncHandler.sync();
|
||||||
new Notice(i18nHelper.getMessage('140302'));
|
new Notice(i18nHelper.getMessage('140302'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error(i18nHelper.getMessage('140206').replace('{0}', e.message), e);
|
log.error(i18nHelper.getMessage('140206', e.message), e);
|
||||||
} finally {
|
} finally {
|
||||||
context.plugin.statusHolder.completeSync();
|
context.plugin.statusHolder.completeSync();
|
||||||
this.clearStatusBarDelay();
|
this.clearStatusBarDelay();
|
||||||
|
|||||||
@ -50,6 +50,13 @@
|
|||||||
|
|
||||||
.obsidian_douban_sync_config{
|
.obsidian_douban_sync_config{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian_douban_sync_selections{
|
||||||
|
width: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user