Skip to content

Commit 15fc591

Browse files
committed
hopefully fix #94
1 parent b4d499e commit 15fc591

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/api/apis/OMDbAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class OMDbAPI extends APIModel {
112112
}
113113

114114
const result = await fetchData.json();
115-
console.debug(result);
115+
// console.debug(result);
116116

117117
if (result.Response === 'False') {
118118
throw Error(`MDB | Received error from ${this.apiName}: ${result.Error}`);

src/modals/MediaDbPreviewModal.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,20 @@ export class MediaDbPreviewModal extends Modal {
4747

4848
const previewWrapper = contentEl.createDiv({ cls: 'media-db-plugin-preview-wrapper' });
4949

50+
this.markdownComponent.load();
51+
5052
for (const result of this.elements) {
5153
previewWrapper.createEl('h3', { text: result.englishTitle });
52-
const fileDiv = previewWrapper.createDiv();
54+
const fileDiv = previewWrapper.createDiv({ cls: 'media-db-plugin-preview'});
5355

5456
let fileContent = await this.plugin.generateMediaDbNoteContents(result, this.createNoteOptions);
5557
fileContent = `\n${fileContent}\n`;
5658

57-
this.markdownComponent.load();
58-
59-
MarkdownRenderer.renderMarkdown(fileContent, fileDiv, null, this.markdownComponent);
59+
try {
60+
await MarkdownRenderer.renderMarkdown(fileContent, fileDiv, "", this.markdownComponent);
61+
} catch (e) {
62+
console.warn(`mdb | error during rendering of preview`, e);
63+
}
6064
}
6165

6266
contentEl.createDiv({ cls: 'media-db-plugin-spacer' });

src/utils/MediaTypeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class MediaTypeManager {
7878
if (!folderPath) {
7979
folderPath = `/`;
8080
}
81-
console.log(folderPath);
81+
// console.log(folderPath);
8282

8383
if (!(await app.vault.adapter.exists(folderPath))) {
8484
await app.vault.createFolder(folderPath);

styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,10 @@ small.media-db-plugin-list-text {
117117
/*outline: 1px solid white;*/
118118
}
119119

120+
.media-db-plugin-preview {
121+
border-radius: var(--modal-radius);
122+
border: var(--modal-border-width) solid var(--modal-border-color);
123+
padding: var(--size-4-4);
124+
}
125+
120126
/* endregion */

0 commit comments

Comments
 (0)