Open android272 opened 3 weeks ago
Strange, I have no issues adding games on 0.7.2. Could you add the console debug (Ctrl + Shift + i
) to see if there's any errors?
Ah I've found why, I tested this with a fresh install and it seems that if you don't have both an omdbAPI and a mobygamesAPI key then you can't search for games. This is strange though because I thought #147 was supposed to fix that
If this is the case for you then you can fix it by creating an omdbAPI and/or mobygamesAPI key, whichever one you're missing.
@mProjectsCode I know you're busy so please take your time but maybe this would be a good moment to re-enable to "selective API disabling" I added in #133? I'm currently using it on my fork without any issues, even with the latest changes (0.7.2).
If you want to I can create a new PR for it or if you prefer I can try to fix #147
I didn't really like how #133 handled the settings, so that is why I disabled it. Tbh I forgot that I wanted to fix that, maybe I can find some time soon.
Tbh I forgot that I wanted to fix that, maybe I can find some time soon.
That would be great yes. I remember you wanted to change/fix the settings but I'm not sure how to improve it myself
There should be some sort of error message to the user, but the search should not fail if one API fails. I guess this is easily fixed through some better error handling.
Currently the search does fail if one of them has no API key and the the errors only show up in the console, most users won't notice them.
If instead of throwing an error it just returns an empty array then the search still works for the other videogame APIs like steam which requires no api key and it'll just skip omdbAPI or mobygamesAPI if those don't have a key.
if (!this.plugin.settings.MobyGamesKey) {
console.error(Error(`MDB | API key for ${this.apiName} missing.`));
return [];
}
rather than
if (!this.plugin.settings.MobyGamesKey) {
throw Error(`MDB | API key for ${this.apiName} missing.`);
}
The error still only shows up in the console but at least the search won't fail anymore. I made a PR for this fix
Sorry I had not looked at my email in a while. It looks like your right @ltctceplrm I am missing the MobyGamesAPI.
plugin:obsidian-media-db-plugin:47 Error: MDB | API key for MobyGamesAPI missing.
at Ni.searchByTitle (plugin:obsidian-media-db-plugin:48:21585)
at eval (plugin:obsidian-media-db-plugin:47:571)
at Array.map (
Adding the API key fixed the issue. I don't remember having to add the API Key before.
Adding the API key fixed the issue. I don't remember having to add the API Key before.
This happened after Mobygames was added but there's a bug fix coming where if you're missing an API key then it'll just skip that API provider and fall back on the other ones.
Could you add a warning saying that "Missing mobygames api key, falling back to [other] api"? I just thought that the plugin was broken all together.
It will say MediaDB | API key for ${this.apiName} missing.
which hopefully will be clear enough for users
I just thought that the plugin was broken all together.
Yeah that was unintentional since it was supposed to give a clearer warning but the warning only showed up in the console
Yep that will work for me
Mostly just FYI as mine was a slightly different case. I had both keys in the plugin's settings, but hadn't activated my OMDb API key and it was failing to authenticate. I went back to the mail I got from OMDb API, noticed the activate link, and it started working. I also thought the plugin was just failing but saw the auth error in the console and then I ran across this issue here. In addition to a warning about missing keys, it would be good to also let users know when there's an auth error. Thanks!
Describe the bug When I activate the Media DB Video Game search, enter a title and press ok the modals go away and no search results are seen.
To Reproduce Steps to reproduce the behavior:
Media DB: Create Media DB entry (Game)
Expected behavior A clear and concise description of what you expected to happen.
I expected to see search results for various titles the API thinks I am looking for like when I search for books, music, or TV shows (all of which work as expected).
Screenshots If applicable, add screenshots to help explain your problem.
Music:![image](https://github.com/user-attachments/assets/cc588d4e-392d-4cc5-8cc6-f28f01e90055)
Book:![image](https://github.com/user-attachments/assets/a8520ef5-13d6-4ee8-9b26-ec91d86cd274)
TV Series:![image](https://github.com/user-attachments/assets/2446bb82-6207-4c99-978d-c9b5d0ade5b4)
Occurs on
Plugin version 0.7.2