update the function of password and icon

This commit is contained in:
Jiaxin Peng
2023-08-09 20:15:47 +01:00
parent 7a2610c4b9
commit 221cf62fcc
2 changed files with 32 additions and 8 deletions

10
main.ts
View File

@@ -80,13 +80,13 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
);
return;
}
const { markDownData, nowFile, tags, type, slug, stats, category, summary } =await this.getNowFileMarkdownContent(this.app);
const { markDownData, nowFile, tags, type, slug, stats, category, summary,paword, favicon } =await this.getNowFileMarkdownContent(this.app);
if (markDownData) {
const { basename } = nowFile;
const upload = new Upload2Notion(this);
const res = await upload.syncMarkdownToNotion(basename, allowTags, tags, type, slug, stats, category, summary, markDownData, nowFile, this.app, this.settings)
const res = await upload.syncMarkdownToNotion(basename, allowTags, tags, type, slug, stats, category, summary, paword, favicon, markDownData, nowFile, this.app, this.settings)
if(res.status === 200){
new Notice(`${langConfig["sync-success"]}${basename}`)
}else {
@@ -104,6 +104,8 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
let stats = ''
let category = ''
let summary = ''
let paword = ''
let favicon = ''
const FileCache = app.metadataCache.getFileCache(nowFile)
try {
@@ -114,6 +116,8 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
stats = FileCache.frontmatter.stats;
category = FileCache.frontmatter.category;
summary = FileCache.frontmatter.summary;
paword = FileCache.frontmatter.password;
favicon = FileCache.frontmatter.icon;
}
} catch (error) {
new Notice(langConfig["set-tags-fail"]);
@@ -129,6 +133,8 @@ export default class ObsidianSyncNotionPlugin extends Plugin {
stats,
category,
summary,
paword,
favicon
};
} else {
new Notice(langConfig["open-file"]);