Closed ltctceplrm closed 5 months ago
I've added a mediaType variable that gets sent with the search query so adding media by media type is currently functional. I still need to fix the advanced APIsearch since that one is broken API's that you can turn off, I think I went wrong somewhere with the API = default check
@mProjectsCode I found the mistake I mentioned and simplified the code by removing the whole "default" API setting, now Advanced Search and Media Type Search both work correctly! I'm looking through your notes now and seeing what I need to change
I reverted changes to main.ts so the this.apiManager.query
method is left alone and instead modified hasType
in APIModel.ts to check whether the API is turned on or not for the media type.
I've tested it out and it correctly skips the disabled APIs when selecting only 1 media type, however if you select multiple media types (movies and games) where the same API (omdb) has been turned off for one media type (movies) but not for another media type (games) then it will still return movies as well as games for omdb. I'm not sure if this is wanted/intentional or not.
Seeing as the plugin is simultaneously searching for games and movies I don't see how it would be possible to exclude just the games returned by omdb without really overcomplicating the code. Unless I'm missing an easy solution I'd suggest maybe only being able to toggle one media type at a time and if you toggle a second one it un-toggles the previous one?
I pushed too soon, there's still a mistake in my toggle thingy
Okay it's fixed now
Please let me know if I should change anything else or if it's good like this
I am currently quite busy, I will review this maybe next week.
That's okay, please take your time. Thank you for looking into it.
Thank you for looking over the code. I'm going to address some of the problems right now and the other ones I'll probably get to tomorrow.
Hello @mProjectsCode, I finally succeeded turning the API toggles into sub objects like you asked, the code additions are once again fully functional (at least according to my tests). I believe I have finished with this pull request but please let me know if I forgot something
I will just merge this and then make some changes myself
That's great, thank you merging and also fixing up the code.
The code is currently not yet functional because I don't know how to get the MediaType so I can add it to the API name. To test if the rest of the code works I modified this line
And it correctly filters out the APIs that are not checked. Same works for
movies
orseries
.@mProjectsCode is there a way to get the media type after it calls APIManager?