mProjectsCode / obsidian-media-db-plugin

A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.
GNU General Public License v3.0
255 stars 31 forks source link

OK button missing in preview dialog #94

Closed sascha-andres closed 1 year ago

sascha-andres commented 1 year ago

I wanted to add another movie and I can't click on OK to create the file in the preview dialog:

image

What I tried:

Is there any work around?

mbryantms commented 1 year ago

I am experiencing the same issue. This happens for all media types and doesn't matter what content is in the template. I can't create an entry for anything.

mProjectsCode commented 1 year ago

I am currently on vacation. I will take a look at it when I am back.

discipleofzen commented 1 year ago

OK button is present on Android, but not on desktop. Functionality is given for Android version.

mProjectsCode commented 1 year ago

I cant reproduce the issue with obsidian 1.3.4 and plugin version 0.5.1.

discipleofzen commented 1 year ago

Obsidian 1.3.4 and Plugin 0.5.1 checked right now, at least movies cannot be added as no OK button is present. Other media not checked. Checked 2023-05-19 20:20 Berlin time.

mProjectsCode commented 1 year ago

which API are you using?

discipleofzen commented 1 year ago

If you could give more details on what to look up, I will do so.

sascha-andres commented 1 year ago

which API are you using?

I am trying to use OMDb

mProjectsCode commented 1 year ago

If you could give more details on what to look up, I will do so.

You could open the developer console and look for any errors that appear there.

discipleofzen commented 1 year ago

Here is a screenshot. If you need more let me know. You can select the movies to import, press okay, and when you enter the preview which you would have to confirm with okay, the errors are displayed instead and the okay button will not be there.

API

mProjectsCode commented 1 year ago

The first error appeared on my end too and it should be fixed with the commit I did yesterday (but i couldn't test it yet), but considering that the buttons are there on my end, it's likely not the root cause. Can you try disableing metadata menu? it seems to be doing something weird to the preview modal.

sascha-andres commented 1 year ago

I do not have metadata menu, but I do see the same errors here

mbryantms commented 1 year ago

Similar for mine: image

I assume the first will be covered by the fixes you mentioned before, but I'm getting a second dataview exception.

mProjectsCode commented 1 year ago

are you using templates that include dataview querries? If so could you send one of those to me?

nikitakuma commented 1 year ago

I had the same problem and checked the console, it was mentioning Supercharged Links every time I tried a MediaDB entry. The OK button came back once I turned off Supercharged Links. Tested this on a few different items and different templates and the OK button came back every time I turned that plugin off

sascha-andres commented 1 year ago

Yes, I do. Here is the movie tmeplate:

[[11.00 Index|Movie list]]

`$= '![Image|360](' + dv.current().image + ')'`

# `$= dv.current().title`

>>>dataviewjs
if (dv.current().watched) {
    dv.paragraph(`> [!SUCCESS] \`INPUT[toggle:watched]\` watched \n last watched on ${dv.current().lastWatched || '---'}`);
} else {
    dv.paragraph(`> [!WARNING] \`INPUT[toggle:watched]\` not yet watched`);
}
>>>

**Rating**:  `INPUT[slider(addLabels, minValue(0), maxValue(10)):personalRating]` (`$= dv.current().personalRating` out of 10)

**Genres**:
>>>dataviewjs
dv.current().genres.length === 0 ? dv.span(' - none') : dv.list(dv.current().genres)
>>>

>>>dataviewjs
if (!dv.current().released) {
    dv.span('**Not released** The movie is not yet released.')
}
>>>

**Type**: `$= dv.current().type` <br />
**Online Rating**: `$= dv.current().onlineRating` <br />
**Duration**:  `$= dv.current().duration` <br />
**Premiered**: `$= dv.current().premiere` <br />
**Producer**: `$= dv.current().producer` <br />

Replaces triple tick with triple gt

mbryantms commented 1 year ago

I have tried with this template and it doesn't work. A movieTemplate I have without a dataview query does allow the Ok button to appear with no issue. Here's the gameTemplate I took which I pulled from the forum or SirVB's or somewhere like that:

gameTemplate

not yet played

Genres:
$= dv.current().genres.length === 0 ? ' - none' : dv.list(dv.current().genres)

Dataview (for inline JS query 'dv.current().genres.length === 0 ? ' - none' : dv.list(dv.current().genres)'): TypeError: Cannot read properties of undefined (reading 'length')
Not released The game is not yet released.
Type:
Online Rating:
Release Date:
mProjectsCode commented 1 year ago

I think I identified the issue. Other plugins are throwing errors in the preview and causing the render process to halt, sometimes before the buttons have been rendered. I guess I will just ignore the errors for now so that the rendering can continue.

mProjectsCode commented 1 year ago

a new release that hopefully fixes the issue is deployed

mbryantms commented 1 year ago

Applied the update in Obsidian. I can confirm it works for all my media types now. Appreciate the help and amazing plugin!

On Tue, May 30, 2023 at 11:35 AM Moritz Jung @.***> wrote:

a new release that hopefully fixes the issue is deployed

— Reply to this email directly, view it on GitHub https://github.com/mProjectsCode/obsidian-media-db-plugin/issues/94#issuecomment-1568653571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAV75GXZ2QTOOQFPOQR63XTXIYHUXANCNFSM6AAAAAAYOHZKTI . You are receiving this because you commented.Message ID: @.***>

nikitakuma commented 1 year ago

Works now with all my plugins, thank you!

mProjectsCode commented 1 year ago

great, then I will close this issue

sascha-andres commented 1 year ago

I can also confirm. Great job!