Skip to content

Commit

Permalink
hopefully fix #94
Browse files Browse the repository at this point in the history
  • Loading branch information
mProjectsCode committed May 30, 2023
1 parent b4d499e commit 15fc591
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/apis/OMDbAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
12 changes: 8 additions & 4 deletions src/modals/MediaDbPreviewModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down
2 changes: 1 addition & 1 deletion src/utils/MediaTypeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 15fc591

Please sign in to comment.