diff --git a/README.md b/README.md index 88d4c66..e7e6abc 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@

Import Movie, Book, Music, Teleplay, Note, Game even Broadcast Data from Douban in [Obsidian](https://obsidian.md/) -在[Obsidian](https://obsidian.md/)使用并导入豆瓣中的电影/书籍/音乐/电视剧/日记/游戏甚至是广播, 包含评分/发布日期/演员表等信息 +在[Obsidian](https://obsidian.md/)使用并导入豆瓣中的电影/书籍/音乐/电视剧/日记/游戏甚至是广播, 包含评分/发布日期/演员表等信息, 登录后还有个人阅读状态等信息 ![background](./doc/background.png) --- @@ -30,6 +30,19 @@ If you want some features or have any questions about this plugin, create issues - [Bugs, Issues, & Feature Requests](https://github.com/Wanxp/obsidian-douban/issues) - [Development Roadmap](https://github.com/users/Wanxp/projects/1) +## Target/功能 +- [x] Import Movie/导入电影 +- [x] Import Teleplay/导入电视剧 +- [x] Import Book/导入书籍 +- [x] Import Music/导入音乐 +- [x] Import Note/导入日记 +- [x] Import Game/导入游戏 +- [x] Personal Comment/导入个人的评论,评论时间,阅读状态,个人评分 +- [x] Attachment Files/支持保存封面至本地 +- [x] Custom Variables/支持自定义参数 +- [ ] Broadcast/广播 + + ## Support Field/支持的字段 (若有缺少想导入的字段, 欢迎提issues反馈) @@ -60,6 +73,8 @@ If you want some features or have any questions about this plugin, create issues | 扩展7 | | | binding:装帧 | | | | | | 扩展8 | | | producer: 出品方 | | | | | + + ## How to use ### Search - Search Data And Create Note @@ -84,14 +99,8 @@ If you want some features or have any questions about this plugin, create issues ![Setting Example2](./doc/setting_en.gif) -## Target -- [x] Movie/电影 -- [x] Teleplay/电视剧 -- [x] Book/书籍 -- [x] Music/音乐 -- [x] Note/日记 -- [x] Game/游戏 -- [ ] Broadcast/广播 + + ## How to install ### From Obsidian @@ -142,7 +151,6 @@ If you want some features or have any questions about this plugin, create issues 7. 享受开发吧 ## 免责声明 -本程序没有爬取任何书影音等内容,只供技术研究使用。没有侵犯书影音作者版权和豆瓣官方利益。如有任何侵权行为,请联系我删除。 - +1. 本程序没有爬取任何书影音等内容,只供技术研究使用。没有侵犯书影音作者版权和豆瓣官方利益。如有任何侵权行为,请联系我删除。 ## Thanks diff --git a/src/constant/DefaultTemplateContent.ts b/src/constant/DefaultTemplateContent.ts index 717c7f0..3a9f382 100644 --- a/src/constant/DefaultTemplateContent.ts +++ b/src/constant/DefaultTemplateContent.ts @@ -128,7 +128,7 @@ doubanId: {{id}} title: {{title}} type: {{type}} score: {{score}} -myRate: {{myRate}} +myRating: {{myRating}} originalTitle: {{originalTitle}} genre: {{genre}} datePublished: {{datePublished}} @@ -158,7 +158,7 @@ series: {{series}} type: {{type}} author: {{author}} score: {{score}} -myRate: {{myRate}} +myRating: {{myRating}} datePublished: {{datePublished}} translator: {{translator}} publisher: {{publisher}} @@ -189,7 +189,7 @@ title: {{title}} type: {{type}} actor: {{actor}} score: {{score}} -myRate: {{myRate}} +myRating: {{myRating}} genre: {{genre}} medium: {{medium}} albumType: {{albumType}} @@ -228,7 +228,7 @@ title: {{title}} aliases: {{aliases}} type: {{type}} score: {{score}} -myRate: {{myRate}} +myRating: {{myRating}} dateTimePublished: {{datePublished}} publisher: {{publisher}} genre: {{genre}} @@ -252,7 +252,7 @@ doubanId: {{id}} title: {{title}} type: {{type}} score: {{score}} -myRate: {{myRate}} +myRating: {{myRating}} originalTitle: {{originalTitle}} genre: {{genre}} datePublished: {{datePublished}} diff --git a/src/douban/component/DoubanLoginModel.ts b/src/douban/component/DoubanLoginModel.ts index f79da70..7ca359a 100644 --- a/src/douban/component/DoubanLoginModel.ts +++ b/src/douban/component/DoubanLoginModel.ts @@ -15,7 +15,6 @@ export default class DoubanLoginModel { constructor(containerEl: HTMLElement, settingsManager: SettingsManager) { this.containerEl = containerEl; this.settingsManager = settingsManager; - log.info('初始化登录页面'); const { remote } = require('electron'); const { BrowserWindow: RemoteBrowserWindow } = remote; diff --git a/src/douban/data/handler/DoubanAbstractLoadHandler.ts b/src/douban/data/handler/DoubanAbstractLoadHandler.ts index 73b12c4..c8b96f8 100644 --- a/src/douban/data/handler/DoubanAbstractLoadHandler.ts +++ b/src/douban/data/handler/DoubanAbstractLoadHandler.ts @@ -133,7 +133,6 @@ export default abstract class DoubanAbstractLoadHandler handle(url: string, context: HandleContext): void { let headers = JSON.parse(this.doubanPlugin.settings.searchHeaders); headers.Cookie = this.doubanPlugin.settings.loginCookiesContent; - console.log(JSON.stringify(headers)) const requestUrlParam: RequestUrlParam = { url: url, method: "GET", @@ -141,7 +140,6 @@ export default abstract class DoubanAbstractLoadHandler throw: true }; request(requestUrlParam) - .then((response) => {console.log(response.toString());return response}) .then(load) .then(this.analysisUserState) .then(({data, userState}) => { @@ -242,7 +240,7 @@ export default abstract class DoubanAbstractLoadHandler private parseUserInfo(resultContent: string, extract: T, context: HandleContext, textMode: TemplateTextMode) { const userState = extract.userState; if ((resultContent.indexOf(DoubanUserParameter.MY_TAGS) >= 0 || - resultContent.indexOf(DoubanUserParameter.MY_RATE) >= 0 || + resultContent.indexOf(DoubanUserParameter.MY_RATING) >= 0 || resultContent.indexOf(DoubanUserParameter.MY_STATE) >= 0 || resultContent.indexOf(DoubanUserParameter.MY_COMMENT) >= 0 || resultContent.indexOf(DoubanUserParameter.MY_COLLECTION_DATE) >= 0 ) && !this.doubanPlugin.userComponent.isLogin()) { @@ -253,7 +251,7 @@ export default abstract class DoubanAbstractLoadHandler return resultContent; } return resultContent.replaceAll(DoubanUserParameter.MY_TAGS, this.handleSpecialContent(userState.tags, textMode, context)) - .replaceAll(DoubanUserParameter.MY_RATE, this.handleSpecialContent(userState.rate, textMode)) + .replaceAll(DoubanUserParameter.MY_RATING, this.handleSpecialContent(userState.rate, textMode)) .replaceAll(DoubanUserParameter.MY_STATE, this.getUserStateName(userState.state)) .replaceAll(DoubanUserParameter.MY_COMMENT, this.handleSpecialContent(userState.comment, textMode)) .replaceAll(DoubanUserParameter.MY_COLLECTION_DATE, moment(new Date()).format(context.settings.dateFormat)) diff --git a/src/douban/data/model/UserStateSubject.ts b/src/douban/data/model/UserStateSubject.ts index 6f83c91..1b396a2 100644 --- a/src/douban/data/model/UserStateSubject.ts +++ b/src/douban/data/model/UserStateSubject.ts @@ -10,7 +10,7 @@ export interface UserStateSubject { export const DoubanUserParameter = { MY_TAGS: '{{myTags}}', - MY_RATE: '{{myRate}}', + MY_RATING: '{{myRating}}', MY_STATE: '{{myState}}', MY_COMMENT: '{{myComment}}', MY_COLLECTION_DATE: '{{myCollectionDate}}', diff --git a/src/douban/setting/TemplateSettingHelper.ts b/src/douban/setting/TemplateSettingHelper.ts index a025017..1c47e7e 100644 --- a/src/douban/setting/TemplateSettingHelper.ts +++ b/src/douban/setting/TemplateSettingHelper.ts @@ -45,7 +45,7 @@ export function createFileSelectionSetting({name, desc, placeholder, key, manage }); setting.addExtraButton((button) => { button - .setIcon('document') + .setIcon('copy') .setTooltip(i18nHelper.getMessage('121903')) .onClick(async () => { // @ts-ignore @@ -54,7 +54,7 @@ export function createFileSelectionSetting({name, desc, placeholder, key, manage }); setting.addExtraButton((button) => { button - .setIcon('copy') + .setIcon('document') .setTooltip(i18nHelper.getMessage('121901')) .onClick(async () => { // @ts-ignore diff --git a/src/douban/setting/TemplateVariableSettingsHelper.ts b/src/douban/setting/TemplateVariableSettingsHelper.ts index fc97ce8..ac7e93f 100644 --- a/src/douban/setting/TemplateVariableSettingsHelper.ts +++ b/src/douban/setting/TemplateVariableSettingsHelper.ts @@ -260,7 +260,7 @@ ${i18nHelper.getMessage('122004')} ${i18nHelper.getMessage('160225')}
myTags → ${i18nHelper.getMessage('160226')}
-myRate → ${i18nHelper.getMessage('160227')}
+myRating → ${i18nHelper.getMessage('160227')}
myState → ${i18nHelper.getMessage('160228')}
myComment → ${i18nHelper.getMessage('160229')}
myCollectionDate → ${i18nHelper.getMessage('160230')}
diff --git a/src/lang/locale/zh-cn.ts b/src/lang/locale/zh-cn.ts index d789da6..d60bea6 100644 --- a/src/lang/locale/zh-cn.ts +++ b/src/lang/locale/zh-cn.ts @@ -154,8 +154,8 @@ export default { '121701': `选择模板文件`, - '121901': `复制'基础'模板内容`, - '121903': `复制'有状态信息'的模板内容. 有状态信息指:模板中有登录后可以用的参数,如myRate(我的评分)等`, + '121901': `复制基础模板内容`, + '121903': `复制含有我的评分的模板内容. 模板中有登录后可以用的参数,如我的评分, 我的阅读状态等`, '130101': `获取数据失败,{0}`,