hopefully fix #94
This commit is contained in:
parent
b4d499e0e4
commit
15fc591b83
4 changed files with 16 additions and 6 deletions
|
|
@ -112,7 +112,7 @@ export class OMDbAPI extends APIModel {
|
|||
}
|
||||
|
||||
const result = await fetchData.json();
|
||||
console.debug(result);
|
||||
// console.debug(result);
|
||||
|
||||
if (result.Response === 'False') {
|
||||
throw Error(`MDB | Received error from ${this.apiName}: ${result.Error}`);
|
||||
|
|
|
|||
|
|
@ -47,16 +47,20 @@ export class MediaDbPreviewModal extends Modal {
|
|||
|
||||
const previewWrapper = contentEl.createDiv({ cls: 'media-db-plugin-preview-wrapper' });
|
||||
|
||||
this.markdownComponent.load();
|
||||
|
||||
for (const result of this.elements) {
|
||||
previewWrapper.createEl('h3', { text: result.englishTitle });
|
||||
const fileDiv = previewWrapper.createDiv();
|
||||
const fileDiv = previewWrapper.createDiv({ cls: 'media-db-plugin-preview'});
|
||||
|
||||
let fileContent = await this.plugin.generateMediaDbNoteContents(result, this.createNoteOptions);
|
||||
fileContent = `\n${fileContent}\n`;
|
||||
|
||||
this.markdownComponent.load();
|
||||
|
||||
MarkdownRenderer.renderMarkdown(fileContent, fileDiv, null, this.markdownComponent);
|
||||
try {
|
||||
await MarkdownRenderer.renderMarkdown(fileContent, fileDiv, "", this.markdownComponent);
|
||||
} catch (e) {
|
||||
console.warn(`mdb | error during rendering of preview`, e);
|
||||
}
|
||||
}
|
||||
|
||||
contentEl.createDiv({ cls: 'media-db-plugin-spacer' });
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ export class MediaTypeManager {
|
|||
if (!folderPath) {
|
||||
folderPath = `/`;
|
||||
}
|
||||
console.log(folderPath);
|
||||
// console.log(folderPath);
|
||||
|
||||
if (!(await app.vault.adapter.exists(folderPath))) {
|
||||
await app.vault.createFolder(folderPath);
|
||||
|
|
|
|||
|
|
@ -117,4 +117,10 @@ small.media-db-plugin-list-text {
|
|||
/*outline: 1px solid white;*/
|
||||
}
|
||||
|
||||
.media-db-plugin-preview {
|
||||
border-radius: var(--modal-radius);
|
||||
border: var(--modal-border-width) solid var(--modal-border-color);
|
||||
padding: var(--size-4-4);
|
||||
}
|
||||
|
||||
/* endregion */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue