happypandax / plugins

Plugins for HappyPanda X
https://happypandax.github.io/
GNU Lesser General Public License v3.0
32 stars 16 forks source link

[EHentai Metadata] Plugin not respecting preferred_language setting. #20

Closed ub333 closed 5 years ago

ub333 commented 5 years ago

Hi. I'd been frustrated by this plugin's inability to prefer english language search results. When I read the readme for the plugin it mentioned a "preferred_language" option that I didn't even know about. Since it's supposed to default to 'english', it should have just been working anyway but it wasn't.

I'm not a programmer but I'm pretty sure I was able to trace the issue to line 223 in EHentai Metadata/main.py:

found_urls = [(str(x.a.string), x.a['href']) for x in results] # title, url

I don't understand this line, but I think that (str(x.a.string) is supposed to extract the gallery title from each search result and for it me is consistently returning "None". When the plugin later goes to look for "english" in that string is then always false.

Since I don't actually know python enough to fix it, I've just added + " language:english" to the search string (i_title) and that'll suit my needs. :laughing:

twiddli commented 5 years ago

Hi, I'll look into it. I could also add an option for a customized search query.

twiddli commented 5 years ago

Added new search_query option that should allow for this in