mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-04 16:48:44 +08:00
add subject user rate info
This commit is contained in:
parent
d212be5a75
commit
556788ee75
10
main.ts
10
main.ts
@ -41,7 +41,7 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
this.showStatus('140205', extract.title);
|
this.showStatus('140205', extract.title);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.showStatus('140206', e.message);
|
log.error(i18nHelper.getMessage('140206').replace('{0}', e.message), e);
|
||||||
} finally {
|
} finally {
|
||||||
this.clearStatusBarDelay();
|
this.clearStatusBarDelay();
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
this.showStatus('140202', resultList.length.toString());
|
this.showStatus('140202', resultList.length.toString());
|
||||||
new DoubanFuzzySuggester(this, context).showSearchList(resultList);
|
new DoubanFuzzySuggester(this, context).showSearchList(resultList);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.showStatus('140206', e.message);
|
log.error(i18nHelper.getMessage('140206').replace('{0}', e.message), e);
|
||||||
} finally {
|
} finally {
|
||||||
this.clearStatusBarDelay();
|
this.clearStatusBarDelay();
|
||||||
}
|
}
|
||||||
@ -111,14 +111,14 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
id: "search-douban-import-and-create-file",
|
id: "search-douban-import-and-create-file",
|
||||||
name: i18nHelper.getMessage("110101"),
|
name: i18nHelper.getMessage("110101"),
|
||||||
callback: () =>
|
callback: () =>
|
||||||
this.getDoubanTextForCreateNewNote({mode: SearchHandleMode.FOR_CREATE, settings: this.settings}),
|
this.getDoubanTextForCreateNewNote({mode: SearchHandleMode.FOR_CREATE, settings: this.settings, userComponent: this.userComponent}),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addCommand({
|
this.addCommand({
|
||||||
id: "search-douban-by-current-file-name",
|
id: "search-douban-by-current-file-name",
|
||||||
name: i18nHelper.getMessage("110001"),
|
name: i18nHelper.getMessage("110001"),
|
||||||
editorCallback: (editor: Editor) =>
|
editorCallback: (editor: Editor) =>
|
||||||
this.getDoubanTextForActiveFile({mode: SearchHandleMode.FOR_REPLACE, settings: this.settings, editor: editor}),
|
this.getDoubanTextForActiveFile({mode: SearchHandleMode.FOR_REPLACE, settings: this.settings, editor: editor, userComponent: this.userComponent}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ export default class DoubanPlugin extends Plugin {
|
|||||||
id: "search-douban-and-input-current-file",
|
id: "search-douban-and-input-current-file",
|
||||||
name: i18nHelper.getMessage("110002"),
|
name: i18nHelper.getMessage("110002"),
|
||||||
editorCallback: (editor: Editor) =>
|
editorCallback: (editor: Editor) =>
|
||||||
this.getDoubanTextForSearchTerm({mode: SearchHandleMode.FOR_REPLACE, settings: this.settings, editor: editor}),
|
this.getDoubanTextForSearchTerm({mode: SearchHandleMode.FOR_REPLACE, settings: this.settings, editor: editor, userComponent: this.userComponent}),
|
||||||
});
|
});
|
||||||
this.settingsManager = new SettingsManager(app, this);
|
this.settingsManager = new SettingsManager(app, this);
|
||||||
this.userComponent = new UserComponent(this.settingsManager);
|
this.userComponent = new UserComponent(this.settingsManager);
|
||||||
|
|||||||
@ -71,11 +71,6 @@ export const PersonNameModeRecords: { [key in PersonNameMode]: string } = {
|
|||||||
[PersonNameMode.CH_EN_NAME]: i18nHelper.getMessage('121208'),
|
[PersonNameMode.CH_EN_NAME]: i18nHelper.getMessage('121208'),
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum DoubanSubjectState {
|
|
||||||
NOT = 'have_not_watched',
|
|
||||||
WANTED = 'wanted',
|
|
||||||
DOING = 'watching',
|
|
||||||
HAS = 'watched',
|
|
||||||
UNKNOWN = 'unknown',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -122,11 +122,164 @@ desc: {{desc}}
|
|||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const DEFAULT_TEMPLATE_CONTENT_WITH_STATE = {
|
||||||
|
movieTemplateFileContent: `---
|
||||||
|
doubanId: {{id}}
|
||||||
|
title: {{title}}
|
||||||
|
type: {{type}}
|
||||||
|
score: {{score}}
|
||||||
|
myRate: {{myRate}}
|
||||||
|
originalTitle: {{originalTitle}}
|
||||||
|
genre: {{genre}}
|
||||||
|
datePublished: {{datePublished}}
|
||||||
|
director: {{director}}
|
||||||
|
actor: {{actor}}
|
||||||
|
author: {{author}}
|
||||||
|
tags: {{type}}, {{myTags}}
|
||||||
|
state: {{myState}}
|
||||||
|
url: {{url}}
|
||||||
|
createTime: {{currentDate}} {{currentTime}}
|
||||||
|
collectionDate: {{myCollectionDate}}
|
||||||
|
desc: {{desc}}
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Comment:
|
||||||
|
---
|
||||||
|
{{myComment}}
|
||||||
|
`,
|
||||||
|
bookTemplateFileContent: `---
|
||||||
|
doubanId: {{id}}
|
||||||
|
title: {{title}}
|
||||||
|
subTitle: {{subTitle}}
|
||||||
|
originalTitle: {{originalTitle}}
|
||||||
|
series: {{series}}
|
||||||
|
type: {{type}}
|
||||||
|
author: {{author}}
|
||||||
|
score: {{score}}
|
||||||
|
myRate: {{myRate}}
|
||||||
|
datePublished: {{datePublished}}
|
||||||
|
translator: {{translator}}
|
||||||
|
publisher: {{publisher}}
|
||||||
|
producer: {{producer}}
|
||||||
|
isbn: {{isbn}}
|
||||||
|
url: {{url}}
|
||||||
|
totalPage: {{totalPage}}
|
||||||
|
price: {{price}}
|
||||||
|
tags: Book, {{myTags}}
|
||||||
|
state: {{myState}}
|
||||||
|
binding: {{binding}}
|
||||||
|
createTime: {{currentDate}} {{currentTime}}
|
||||||
|
collectionDate: {{myCollectionDate}}
|
||||||
|
desc: {{desc}}
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Comment:
|
||||||
|
---
|
||||||
|
{{myComment}}
|
||||||
|
|
||||||
|
{{menu}}
|
||||||
|
`,
|
||||||
|
musicTemplateFileContent: `---
|
||||||
|
doubanId: {{id}}
|
||||||
|
title: {{title}}
|
||||||
|
type: {{type}}
|
||||||
|
actor: {{actor}}
|
||||||
|
score: {{score}}
|
||||||
|
myRate: {{myRate}}
|
||||||
|
genre: {{genre}}
|
||||||
|
medium: {{medium}}
|
||||||
|
albumType: {{albumType}}
|
||||||
|
datePublished: {{datePublished}}
|
||||||
|
publisher: {{publisher}}
|
||||||
|
barcode: {{barcode}}
|
||||||
|
url: {{url}}
|
||||||
|
records: {{records}}
|
||||||
|
tags: Music, {{myTags}}
|
||||||
|
state: {{myState}}
|
||||||
|
createTime: {{currentDate}} {{currentTime}}
|
||||||
|
collectionDate: {{myCollectionDate}}
|
||||||
|
desc: {{desc}}
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
`,
|
||||||
|
noteTemplateFileContent: `---
|
||||||
|
doubanId: {{id}}
|
||||||
|
title: {{title}}
|
||||||
|
type: {{type}}
|
||||||
|
author: {{author}}
|
||||||
|
authorUrl: {{authorUrl}}
|
||||||
|
dateTimePublished: {{datePublished}} {{timePublished}}
|
||||||
|
url: {{url}}
|
||||||
|
tags: Article
|
||||||
|
createTime: {{currentDate}} {{currentTime}}
|
||||||
|
desc: {{desc}}
|
||||||
|
---
|
||||||
|
|
||||||
|
{{content}}
|
||||||
|
`,
|
||||||
|
gameTemplateFileContent: `---
|
||||||
|
doubanId: {{id}}
|
||||||
|
title: {{title}}
|
||||||
|
aliases: {{aliases}}
|
||||||
|
type: {{type}}
|
||||||
|
score: {{score}}
|
||||||
|
myRate: {{myRate}}
|
||||||
|
dateTimePublished: {{datePublished}}
|
||||||
|
publisher: {{publisher}}
|
||||||
|
genre: {{genre}}
|
||||||
|
developer: {{developer}}
|
||||||
|
platform: {{platform}}
|
||||||
|
url: {{url}}
|
||||||
|
tags: Game, {{myTags}}
|
||||||
|
state: {{myState}}
|
||||||
|
createTime: {{currentDate}} {{currentTime}}
|
||||||
|
collectionDate: {{myCollectionDate}}
|
||||||
|
desc: {{desc}}
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Comment:
|
||||||
|
---
|
||||||
|
{{myComment}}
|
||||||
|
`,teleplayTemplateFileContent: `---
|
||||||
|
doubanId: {{id}}
|
||||||
|
title: {{title}}
|
||||||
|
type: {{type}}
|
||||||
|
score: {{score}}
|
||||||
|
myRate: {{myRate}}
|
||||||
|
originalTitle: {{originalTitle}}
|
||||||
|
genre: {{genre}}
|
||||||
|
datePublished: {{datePublished}}
|
||||||
|
director: {{director}}
|
||||||
|
actor: {{actor}}
|
||||||
|
author: {{author}}
|
||||||
|
tags: {{type}}, {{myTags}}
|
||||||
|
state: {{myState}}
|
||||||
|
url: {{url}}
|
||||||
|
createTime: {{currentDate}} {{currentTime}}
|
||||||
|
collectionDate: {{myCollectionDate}}
|
||||||
|
desc: {{desc}}
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Comment:
|
||||||
|
---
|
||||||
|
{{myComment}}
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取默认的文档内容
|
* 获取默认的文档内容
|
||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
export function getDefaultTemplateContent(key: TemplateKey): string {
|
export function getDefaultTemplateContent(key: TemplateKey, useStateTemplate: boolean = true): string {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return DEFAULT_TEMPLATE_CONTENT[key + "Content"];
|
return useStateTemplate ? DEFAULT_TEMPLATE_CONTENT_WITH_STATE[key + "Content"] : DEFAULT_TEMPLATE_CONTENT[key + "Content"];
|
||||||
}
|
}
|
||||||
|
|||||||
78
src/constant/DoubanUserState.ts
Normal file
78
src/constant/DoubanUserState.ts
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import {i18nHelper} from "../lang/helper";
|
||||||
|
import {SupportType} from "./Constsant";
|
||||||
|
|
||||||
|
export enum DoubanSubjectState {
|
||||||
|
HAVE_NOT = 'HAVE_NOT',
|
||||||
|
WANTED = 'WANTED',
|
||||||
|
DOING = 'DOING',
|
||||||
|
DONE = 'DONE',
|
||||||
|
UNKNOWN = 'UNKNOWN',
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_ALL: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500101'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500102'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500103'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500104'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_MOVIE: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500201'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500202'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500203'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500204'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_BOOK: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500301'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500302'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500303'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500304'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_MUSIC: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500401'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500402'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500403'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500404'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_NOTE: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500501'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500502'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500503'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500504'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_GAME: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500601'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500602'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500603'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500604'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords_TELEPLAY: { [key in DoubanSubjectState]: string } = {
|
||||||
|
[DoubanSubjectState.HAVE_NOT]: i18nHelper.getMessage('500701'),
|
||||||
|
[DoubanSubjectState.WANTED]: i18nHelper.getMessage('500702'),
|
||||||
|
[DoubanSubjectState.DOING]: i18nHelper.getMessage('500703'),
|
||||||
|
[DoubanSubjectState.DONE]: i18nHelper.getMessage('500704'),
|
||||||
|
[DoubanSubjectState.UNKNOWN]: i18nHelper.getMessage('500000'),
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DoubanSubjectStateRecords: { [key in SupportType]: Record<DoubanSubjectState, string> } = {
|
||||||
|
[SupportType.ALL]:DoubanSubjectStateRecords_ALL,
|
||||||
|
[SupportType.MOVIE]:DoubanSubjectStateRecords_MOVIE,
|
||||||
|
[SupportType.BOOK]:DoubanSubjectStateRecords_BOOK,
|
||||||
|
[SupportType.MUSIC]:DoubanSubjectStateRecords_MUSIC,
|
||||||
|
[SupportType.NOTE]:DoubanSubjectStateRecords_NOTE,
|
||||||
|
[SupportType.GAME]:DoubanSubjectStateRecords_GAME,
|
||||||
|
[SupportType.TELEPLAY]:DoubanSubjectStateRecords_TELEPLAY,
|
||||||
|
|
||||||
|
}
|
||||||
@ -8,7 +8,6 @@ import {CheerioAPI, load} from "cheerio";
|
|||||||
import YamlUtil from "../../../utils/YamlUtil";
|
import YamlUtil from "../../../utils/YamlUtil";
|
||||||
import {
|
import {
|
||||||
BasicConst,
|
BasicConst,
|
||||||
DoubanSubjectState,
|
|
||||||
PersonNameMode,
|
PersonNameMode,
|
||||||
SearchHandleMode,
|
SearchHandleMode,
|
||||||
SupportType,
|
SupportType,
|
||||||
@ -20,7 +19,8 @@ import HandleResult from "@App/data/model/HandleResult";
|
|||||||
import {getDefaultTemplateContent} from "../../../constant/DefaultTemplateContent";
|
import {getDefaultTemplateContent} from "../../../constant/DefaultTemplateContent";
|
||||||
import StringUtil from "../../../utils/StringUtil";
|
import StringUtil from "../../../utils/StringUtil";
|
||||||
import {DEFAULT_SETTINGS} from "../../../constant/DefaultSettings";
|
import {DEFAULT_SETTINGS} from "../../../constant/DefaultSettings";
|
||||||
import {UserStateSubject} from "@App/data/model/UserStateSubject";
|
import {DoubanUserParameter, UserStateSubject} from "@App/data/model/UserStateSubject";
|
||||||
|
import {DoubanSubjectState, DoubanSubjectStateRecords} from "../../../constant/DoubanUserState";
|
||||||
|
|
||||||
export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject> implements DoubanSubjectLoadHandler<T> {
|
export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject> implements DoubanSubjectLoadHandler<T> {
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
}
|
}
|
||||||
|
|
||||||
async parse(extract: T, context: HandleContext): Promise<HandleResult> {
|
async parse(extract: T, context: HandleContext): Promise<HandleResult> {
|
||||||
let template: string = await this.getTemplate(context);
|
let template: string = await this.getTemplate(extract, context);
|
||||||
let frontMatterStart: number = template.indexOf(BasicConst.YAML_FRONT_MATTER_SYMBOL, 0);
|
let frontMatterStart: number = template.indexOf(BasicConst.YAML_FRONT_MATTER_SYMBOL, 0);
|
||||||
let frontMatterEnd: number = template.indexOf(BasicConst.YAML_FRONT_MATTER_SYMBOL, frontMatterStart + 1);
|
let frontMatterEnd: number = template.indexOf(BasicConst.YAML_FRONT_MATTER_SYMBOL, frontMatterStart + 1);
|
||||||
let frontMatter: string = '';
|
let frontMatter: string = '';
|
||||||
@ -154,7 +154,7 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
.error(
|
.error(
|
||||||
i18nHelper.getMessage('130101')
|
i18nHelper.getMessage('130101')
|
||||||
.replace('{0}', e.toString())
|
.replace('{0}', e.toString())
|
||||||
));
|
, e));
|
||||||
;
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -234,9 +234,30 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
.replaceAll(DoubanParameter.CURRENT_TIME, moment(new Date()).format(context.settings.timeFormat))
|
.replaceAll(DoubanParameter.CURRENT_TIME, moment(new Date()).format(context.settings.timeFormat))
|
||||||
.replaceAll(DoubanParameter.GENRE, this.handleSpecialContent(extract.genre, textMode, context))
|
.replaceAll(DoubanParameter.GENRE, this.handleSpecialContent(extract.genre, textMode, context))
|
||||||
;
|
;
|
||||||
|
resultContent = this.parseUserInfo(resultContent, extract, context, textMode);
|
||||||
return this.parseText(resultContent, extract, context, textMode);
|
return this.parseText(resultContent, extract, context, textMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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_STATE) >= 0 ||
|
||||||
|
resultContent.indexOf(DoubanUserParameter.MY_COMMENT) >= 0 ||
|
||||||
|
resultContent.indexOf(DoubanUserParameter.MY_COLLECTION_DATE) >= 0 ) && !this.doubanPlugin.userComponent.isLogin()) {
|
||||||
|
log.warn(i18nHelper.getMessage('100113'));
|
||||||
|
return resultContent;
|
||||||
|
}
|
||||||
|
if (!userState || !userState.collectionDate) {
|
||||||
|
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_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))
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理自定义参数
|
* 处理自定义参数
|
||||||
* @param template
|
* @param template
|
||||||
@ -286,15 +307,18 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
return templateKey;
|
return templateKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getTemplate(context: HandleContext): Promise<string> {
|
private async getTemplate(extract: T, context: HandleContext): Promise<string> {
|
||||||
const tempKey: TemplateKey = this.getTemplateKey();
|
const tempKey: TemplateKey = this.getTemplateKey();
|
||||||
const templatePath: string = context.settings[tempKey];
|
const templatePath: string = context.settings[tempKey];
|
||||||
|
const useUserState:boolean = context.userComponent.isLogin() &&
|
||||||
|
extract.userState &&
|
||||||
|
extract.userState.collectionDate != null &&
|
||||||
|
extract.userState.collectionDate != undefined;
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (!templatePath || StringUtil.isBlank(templatePath)) {
|
if (!templatePath || StringUtil.isBlank(templatePath)) {
|
||||||
return getDefaultTemplateContent(tempKey);
|
return getDefaultTemplateContent(tempKey, useUserState);
|
||||||
}
|
}
|
||||||
const defaultContent = getDefaultTemplateContent(tempKey);
|
const defaultContent = getDefaultTemplateContent(tempKey, useUserState);
|
||||||
let firstLinkpathDest: TFile = this.doubanPlugin.app.metadataCache.getFirstLinkpathDest(templatePath, '');
|
let firstLinkpathDest: TFile = this.doubanPlugin.app.metadataCache.getFirstLinkpathDest(templatePath, '');
|
||||||
if (!firstLinkpathDest) {
|
if (!firstLinkpathDest) {
|
||||||
return defaultContent;
|
return defaultContent;
|
||||||
@ -338,11 +362,30 @@ export default abstract class DoubanAbstractLoadHandler<T extends DoubanSubject>
|
|||||||
}else if(stateWord.indexOf('在')>=0) {
|
}else if(stateWord.indexOf('在')>=0) {
|
||||||
state = DoubanSubjectState.DOING;
|
state = DoubanSubjectState.DOING;
|
||||||
}else if(stateWord.indexOf('过')>=0) {
|
}else if(stateWord.indexOf('过')>=0) {
|
||||||
state = DoubanSubjectState.HAS;
|
state = DoubanSubjectState.DONE;
|
||||||
}else {
|
}else {
|
||||||
state = DoubanSubjectState.NOT;
|
state = DoubanSubjectState.HAVE_NOT;
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getUserStateName(state: DoubanSubjectState): string {
|
||||||
|
if (!state) {
|
||||||
|
return DoubanSubjectStateRecords.ALL.UNKNOWN;
|
||||||
|
}
|
||||||
|
let v = DoubanSubjectStateRecords[this.getSupportType()];
|
||||||
|
switch (state) {
|
||||||
|
case DoubanSubjectState.WANTED:
|
||||||
|
return v.WANTED;
|
||||||
|
case DoubanSubjectState.DOING:
|
||||||
|
return v.DOING;
|
||||||
|
case DoubanSubjectState.DONE:
|
||||||
|
return v.DONE;
|
||||||
|
case DoubanSubjectState.HAVE_NOT:
|
||||||
|
return v.HAVE_NOT;
|
||||||
|
default:
|
||||||
|
return v.UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import {SearchHandleMode} from "../../../constant/Constsant";
|
import {SearchHandleMode} from "../../../constant/Constsant";
|
||||||
import {Editor} from "obsidian";
|
import {Editor} from "obsidian";
|
||||||
import { DoubanPluginSetting } from "@App/setting/model/DoubanPluginSetting";
|
import { DoubanPluginSetting } from "@App/setting/model/DoubanPluginSetting";
|
||||||
|
import UserComponent from "@App/user/UserComponent";
|
||||||
|
|
||||||
export default interface HandleContext {
|
export default interface HandleContext {
|
||||||
mode:SearchHandleMode;
|
mode:SearchHandleMode;
|
||||||
settings: DoubanPluginSetting;
|
settings: DoubanPluginSetting;
|
||||||
editor?:Editor;
|
editor?:Editor;
|
||||||
|
userComponent: UserComponent;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import {DoubanSubjectState} from "../../../constant/Constsant";
|
import { DoubanSubjectState } from "src/constant/DoubanUserState";
|
||||||
|
|
||||||
export interface UserStateSubject {
|
export interface UserStateSubject {
|
||||||
tags: string[];
|
tags: string[];
|
||||||
@ -7,3 +7,11 @@ export interface UserStateSubject {
|
|||||||
comment: string;
|
comment: string;
|
||||||
collectionDate: Date;
|
collectionDate: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const DoubanUserParameter = {
|
||||||
|
MY_TAGS: '{{myTags}}',
|
||||||
|
MY_RATE: '{{myRate}}',
|
||||||
|
MY_STATE: '{{myState}}',
|
||||||
|
MY_COMMENT: '{{myComment}}',
|
||||||
|
MY_COLLECTION_DATE: '{{myCollectionDate}}',
|
||||||
|
}
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class DoubanFuzzySuggester extends FuzzySuggestModal<DoubanSearchResultSubject>
|
|||||||
try {
|
try {
|
||||||
this.open();
|
this.open();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.error(e);
|
log.error(e.toString(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export default class Searcher {
|
|||||||
return request(requestUrlParam)
|
return request(requestUrlParam)
|
||||||
.then(load)
|
.then(load)
|
||||||
.then(SearchParserHandler.parseSearch)
|
.then(SearchParserHandler.parseSearch)
|
||||||
.catch(e => log.error(i18nHelper.getMessage('130101').replace('{0}', e.toString())));
|
.catch(e => log.error(i18nHelper.getMessage('130101').replace('{0}', e.toString()), e));
|
||||||
;
|
;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -118,9 +118,9 @@ export function constructDoubanTokenSettingsUI(containerEl: HTMLElement, manager
|
|||||||
|
|
||||||
|
|
||||||
export function constructLoginSettingsUI(containerEl: HTMLElement, manager: SettingsManager) {
|
export function constructLoginSettingsUI(containerEl: HTMLElement, manager: SettingsManager) {
|
||||||
new Setting(containerEl).setName('登录豆瓣').addButton((button) => {
|
new Setting(containerEl).setName(i18nHelper.getMessage('100131')).addButton((button) => {
|
||||||
return button
|
return button
|
||||||
.setButtonText('登录')
|
.setButtonText(i18nHelper.getMessage('100130'))
|
||||||
.setCta()
|
.setCta()
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
button.setDisabled(true);
|
button.setDisabled(true);
|
||||||
@ -134,16 +134,17 @@ export function constructHasLoginSettingsUI(containerEl: HTMLElement, manager: S
|
|||||||
const user: User = manager.plugin.userComponent.getUser();
|
const user: User = manager.plugin.userComponent.getUser();
|
||||||
let userDom = new DocumentFragment();
|
let userDom = new DocumentFragment();
|
||||||
userDom.createDiv().innerHTML =
|
userDom.createDiv().innerHTML =
|
||||||
`已登录<br>
|
`${i18nHelper.getMessage('100120')}<br>
|
||||||
豆瓣ID: <a href="https://www.douban.com/people/${user.id}/">${user.id}</a><br>
|
${i18nHelper.getMessage('100123')}: <a href="https://www.douban.com/people/${user.id}/">${user.id}</a><br>
|
||||||
昵称: ${user.name}`;
|
${i18nHelper.getMessage('100124')}: ${user.name}<br>
|
||||||
|
${i18nHelper.getMessage('100125')}`;
|
||||||
|
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName('豆瓣用户信息')
|
.setName(i18nHelper.getMessage('100126'))
|
||||||
.setDesc(userDom)
|
.setDesc(userDom)
|
||||||
.addButton((button) => {
|
.addButton((button) => {
|
||||||
return button
|
return button
|
||||||
.setButtonText('登出')
|
.setButtonText(i18nHelper.getMessage('100128'))
|
||||||
.setCta()
|
.setCta()
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
button.setDisabled(true);
|
button.setDisabled(true);
|
||||||
@ -156,17 +157,24 @@ export function constructHasLoginSettingsUI(containerEl: HTMLElement, manager: S
|
|||||||
|
|
||||||
function showMobileLogin(containerEl: HTMLElement, manager: SettingsManager) {
|
function showMobileLogin(containerEl: HTMLElement, manager: SettingsManager) {
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName('豆瓣用户信息')
|
.setName(i18nHelper.getMessage('100126'))
|
||||||
.setDesc('豆瓣未登录,请先在电脑端登录!')
|
.setDesc(i18nHelper.getMessage('100129'))
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMobileLogout(containerEl: HTMLElement, manager: SettingsManager) {
|
function showMobileLogout(containerEl: HTMLElement, manager: SettingsManager) {
|
||||||
|
const user: User = manager.plugin.userComponent.getUser();
|
||||||
|
let userDom = new DocumentFragment();
|
||||||
|
userDom.createDiv().innerHTML =
|
||||||
|
`已登录<br>
|
||||||
|
豆瓣ID: <a href="https://www.douban.com/people/${user.id}/">${user.id}</a><br>
|
||||||
|
昵称: ${user.name}<br>
|
||||||
|
登录后导入参数可使用你的评分以及阅读状态等,具体可用参数见最后.`;
|
||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName('豆瓣用户信息')
|
.setName(i18nHelper.getMessage('100126'))
|
||||||
.setDesc('已登录')
|
.setDesc(userDom)
|
||||||
.addButton((button) => {
|
.addButton((button) => {
|
||||||
return button
|
return button
|
||||||
.setButtonText('登出')
|
.setButtonText(i18nHelper.getMessage('100128'))
|
||||||
.setCta()
|
.setCta()
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
manager.updateSetting('loginCookiesContent', '');
|
manager.updateSetting('loginCookiesContent', '');
|
||||||
|
|||||||
@ -43,13 +43,22 @@ export function createFileSelectionSetting({name, desc, placeholder, key, manage
|
|||||||
manager.updateSetting(key, value);
|
manager.updateSetting(key, value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
setting.addExtraButton((button) => {
|
||||||
|
button
|
||||||
|
.setIcon('document')
|
||||||
|
.setTooltip(i18nHelper.getMessage('121903'))
|
||||||
|
.onClick(async () => {
|
||||||
|
// @ts-ignore
|
||||||
|
navigator.clipboard.writeText(getDefaultTemplateContent(key))
|
||||||
|
});
|
||||||
|
});
|
||||||
setting.addExtraButton((button) => {
|
setting.addExtraButton((button) => {
|
||||||
button
|
button
|
||||||
.setIcon('copy')
|
.setIcon('copy')
|
||||||
.setTooltip(i18nHelper.getMessage('121901'))
|
.setTooltip(i18nHelper.getMessage('121901'))
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
navigator.clipboard.writeText(getDefaultTemplateContent(key))
|
navigator.clipboard.writeText(getDefaultTemplateContent(key, false))
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -253,4 +253,22 @@ ${i18nHelper.getMessage('122004')}
|
|||||||
new Setting(containerEl)
|
new Setting(containerEl)
|
||||||
.setName(i18nHelper.getMessage('122002'))
|
.setName(i18nHelper.getMessage('122002'))
|
||||||
.setDesc(extraVariablesTable);
|
.setDesc(extraVariablesTable);
|
||||||
|
|
||||||
|
|
||||||
|
const userInfoVariables = new DocumentFragment();
|
||||||
|
userInfoVariables.createDiv().innerHTML = `
|
||||||
|
${i18nHelper.getMessage('160225')}
|
||||||
|
<br>
|
||||||
|
<strong>myTags</strong> → ${i18nHelper.getMessage('160226')}<br>
|
||||||
|
<strong>myRate</strong> → ${i18nHelper.getMessage('160227')}<br>
|
||||||
|
<strong>myState</strong> → ${i18nHelper.getMessage('160228')}<br>
|
||||||
|
<strong>myComment</strong> → ${i18nHelper.getMessage('160229')}<br>
|
||||||
|
<strong>myCollectionDate</strong> → ${i18nHelper.getMessage('160230')}<br>
|
||||||
|
|
||||||
|
|
||||||
|
`
|
||||||
|
;
|
||||||
|
new Setting(containerEl)
|
||||||
|
.setName(i18nHelper.getMessage('122002'))
|
||||||
|
.setDesc(userInfoVariables);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export default class UserComponent {
|
|||||||
return request(requestUrlParam)
|
return request(requestUrlParam)
|
||||||
.then(load)
|
.then(load)
|
||||||
.then(this.getUserInfo)
|
.then(this.getUserInfo)
|
||||||
.catch(e => log.error(i18nHelper.getMessage('130101').replace('{0}', e.toString())));
|
.catch(e => log.error(i18nHelper.getMessage('130101').replace('{0}', e.toString()), e));
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,7 @@ export default class FileHandler {
|
|||||||
const leaf = this._app.workspace.splitLeafOrActive();
|
const leaf = this._app.workspace.splitLeafOrActive();
|
||||||
await leaf.openFile(File);
|
await leaf.openFile(File);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error.toString());
|
log.error(error.toString(), error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ export default class FileHandler {
|
|||||||
err
|
err
|
||||||
);
|
);
|
||||||
//TODO i18n
|
//TODO i18n
|
||||||
log.error(i18nHelper.getMessage('110202').replace('{0}', normalizedTemplatePath ?? ''));
|
log.error(i18nHelper.getMessage('110202').replace('{0}', normalizedTemplatePath ?? ''), err);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,19 @@ export default {
|
|||||||
|
|
||||||
'100101': `Login Douban`,
|
'100101': `Login Douban`,
|
||||||
'100111': `Douban login info Expired, please login again`,
|
'100111': `Douban login info Expired, please login again`,
|
||||||
|
'100113': `Could not replace user info, please login again`,
|
||||||
|
'100120': `Login Success`,
|
||||||
|
'100121': `Please login`,
|
||||||
|
'100122': `Nickname`,
|
||||||
|
'100123': `DoubanID`,
|
||||||
|
'100124': `Nickname`,
|
||||||
|
'100125': `You can use your rating and reading status after logging in, see the last for specific variables.`,
|
||||||
|
|
||||||
|
'100126': `User Info`,
|
||||||
|
'100128': `Logout`,
|
||||||
|
'100129': `You have not login Douban, please login in computer first! After login, you can use your rating and reading status, see the last for specific variables.`,
|
||||||
|
'100130': `Login`,
|
||||||
|
'100131': `Login Douban`,
|
||||||
|
|
||||||
|
|
||||||
'1210': `Basic Setting`,
|
'1210': `Basic Setting`,
|
||||||
@ -131,6 +144,7 @@ export default {
|
|||||||
|
|
||||||
'121901': `Copy default template content to clipboard`,
|
'121901': `Copy default template content to clipboard`,
|
||||||
'121902': `Reset to default value`,
|
'121902': `Reset to default value`,
|
||||||
|
'121903': `Copy default template content (that your state in object) to clipboard`,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -337,6 +351,49 @@ export default {
|
|||||||
'330102': `当前时间`,
|
'330102': `当前时间`,
|
||||||
|
|
||||||
|
|
||||||
|
'500000': `UNKNOWN`,
|
||||||
|
'500101': `NOT`,
|
||||||
|
'500102': `WANTED`,
|
||||||
|
'500103': `DOING`,
|
||||||
|
'500104': `DONE`,
|
||||||
|
|
||||||
|
'500201': `NOT`,
|
||||||
|
'500202': `WANTED`,
|
||||||
|
'500203': `DOING`,
|
||||||
|
'500204': `DONE`,
|
||||||
|
|
||||||
|
'500301': `NOT`,
|
||||||
|
'500302': `WANTED`,
|
||||||
|
'500303': `DOING`,
|
||||||
|
'500304': `DONE`,
|
||||||
|
|
||||||
|
'500401': `NOT`,
|
||||||
|
'500402': `WANTED`,
|
||||||
|
'500403': `DOING`,
|
||||||
|
'500404': `DONE`,
|
||||||
|
|
||||||
|
'500501': `NOT`,
|
||||||
|
'500502': `WANTED`,
|
||||||
|
'500503': `DOING`,
|
||||||
|
'500504': `DONE`,
|
||||||
|
|
||||||
|
'500601': `NOT`,
|
||||||
|
'500602': `WANTED`,
|
||||||
|
'500603': `DOING`,
|
||||||
|
'500604': `DONE`,
|
||||||
|
|
||||||
|
'500701': `NOT`,
|
||||||
|
'500702': `WANTED`,
|
||||||
|
'500703': `DOING`,
|
||||||
|
'500704': `DONE`,
|
||||||
|
|
||||||
|
'160225': `You can use those variables in your template after login. `,
|
||||||
|
'160226': `The tags that I tag for subject`,
|
||||||
|
'160227': `The rate that I rate to subject. (1-5)`,
|
||||||
|
'160228': `My state at book-reading/video-watching.`,
|
||||||
|
'160229': `Comment`,
|
||||||
|
'160230': `Rate Date`,
|
||||||
|
|
||||||
'ALL': `all`,
|
'ALL': `all`,
|
||||||
'MOVIE': `movie`,
|
'MOVIE': `movie`,
|
||||||
'BOOK': `book`,
|
'BOOK': `book`,
|
||||||
|
|||||||
@ -15,6 +15,22 @@ export default {
|
|||||||
|
|
||||||
'100101': `登录豆瓣`,
|
'100101': `登录豆瓣`,
|
||||||
'100111': `豆瓣登录信息过期,请至Douban插件重新登录`,
|
'100111': `豆瓣登录信息过期,请至Douban插件重新登录`,
|
||||||
|
'100113': `无法替换用户信息变量, 登录信息过期, 请重新登录Douban`,
|
||||||
|
'100120': `已登录`,
|
||||||
|
'100121': `请登录`,
|
||||||
|
'100122': `昵称`,
|
||||||
|
'100123': `豆瓣ID`,
|
||||||
|
'100124': `昵称`,
|
||||||
|
'100125': `登录后, 可使用你的评分/阅读状态等作为导入参数,具体可用参数见最后.`,
|
||||||
|
|
||||||
|
'100126': `豆瓣用户信息`,
|
||||||
|
'100128': `登出`,
|
||||||
|
'100129': `豆瓣未登录,请先在电脑端登录!登录后导入参数可使用你的评分以及阅读状态等,具体可用参数见最后.`,
|
||||||
|
'100130': `登录`,
|
||||||
|
'100131': `登录豆瓣`,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//DoubanSettingTab
|
//DoubanSettingTab
|
||||||
@ -131,7 +147,9 @@ export default {
|
|||||||
'121701': `选择模板文件`,
|
'121701': `选择模板文件`,
|
||||||
|
|
||||||
|
|
||||||
'121901': `复制'默认'模板内容`,
|
'121901': `复制'基础'模板内容`,
|
||||||
|
'121903': `复制'有状态信息'的模板内容. 有状态信息指:模板中有登录后可以用的参数,如myRate(我的评分)等`,
|
||||||
|
|
||||||
|
|
||||||
'130101': `获取数据失败,{0}`,
|
'130101': `获取数据失败,{0}`,
|
||||||
'130102': `Obsidian Douban插件错误提示:`,
|
'130102': `Obsidian Douban插件错误提示:`,
|
||||||
@ -357,6 +375,51 @@ export default {
|
|||||||
'330102': `当前时间`,
|
'330102': `当前时间`,
|
||||||
|
|
||||||
|
|
||||||
|
'500000': `未知`,
|
||||||
|
'500101': `未做`,
|
||||||
|
'500102': `想做`,
|
||||||
|
'500103': `正在做`,
|
||||||
|
'500104': `做完`,
|
||||||
|
|
||||||
|
'500201': `未看`,
|
||||||
|
'500202': `想看`,
|
||||||
|
'500203': `在看`,
|
||||||
|
'500204': `看过`,
|
||||||
|
|
||||||
|
'500301': `未看`,
|
||||||
|
'500302': `想看`,
|
||||||
|
'500303': `在看`,
|
||||||
|
'500304': `看过`,
|
||||||
|
|
||||||
|
'500401': `未听`,
|
||||||
|
'500402': `想听`,
|
||||||
|
'500403': `在听`,
|
||||||
|
'500404': `听过`,
|
||||||
|
|
||||||
|
'500501': `未看`,
|
||||||
|
'500502': `想看`,
|
||||||
|
'500503': `在看`,
|
||||||
|
'500504': `看过`,
|
||||||
|
|
||||||
|
'500601': `未玩`,
|
||||||
|
'500602': `想玩`,
|
||||||
|
'500603': `在玩`,
|
||||||
|
'500604': `玩过`,
|
||||||
|
|
||||||
|
'500701': `未看`,
|
||||||
|
'500702': `想看`,
|
||||||
|
'500703': `在看`,
|
||||||
|
'500704': `看过`,
|
||||||
|
|
||||||
|
|
||||||
|
'160225': `以下参数登录后方可在模板中使用, 使用时请用'{{}}'包裹, 举例: 参数myTags, 则使用时为{{myTags}}`,
|
||||||
|
'160226': `我标记的标签`,
|
||||||
|
'160227': `我的评分(1-5)`,
|
||||||
|
'160228': `我的阅读/欣赏/听/玩的状态`,
|
||||||
|
'160229': `我的评论`,
|
||||||
|
'160230': `我的评论/标记的日期`,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'ALL': `全部类型`,
|
'ALL': `全部类型`,
|
||||||
'MOVIE': `电影`,
|
'MOVIE': `电影`,
|
||||||
|
|||||||
@ -3,15 +3,22 @@ import {i18nHelper} from "src/lang/helper";
|
|||||||
|
|
||||||
class Logger {
|
class Logger {
|
||||||
|
|
||||||
public error(e: any): any {
|
public error(msg: any, e:any): any {
|
||||||
|
new Notice(msg);
|
||||||
|
console.log(`Douban Plugin error: ${msg}`);
|
||||||
|
console.error(e);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public notice(e: any): any {
|
||||||
new Notice(e);
|
new Notice(e);
|
||||||
console.log(`Douban Plugin error: ${e}`);
|
console.error(`Douban Plugin notice: ${e}`);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
public warn(e: any): any {
|
public warn(e: any): any {
|
||||||
new Notice(e);
|
new Notice(e);
|
||||||
console.log(`Douban Plugin error: ${e}`);
|
console.warn(`Douban Plugin error: ${e}`);
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user