Pfuenzle / AnisearchKomga

A Metadata Provider for Komga using AniSearch
37 stars 18 forks source link

Bugfix for genre/tags mixup with current anisearch website #7

Open TheRealC0unt opened 1 year ago

TheRealC0unt commented 1 year ago

The current release of the script contains a bug related to the genres/tags, at least with the now current version of the anisearch website. Since tags have become a subcategory of genres, the URL pattern investigated "recognizes" the tags as genres by accident.

The fix in mangaMetadata.py is simple. Starting at row 333, replace the code block with this one:

tagurl = html_dom.xpath("//*[@id=\"description\"]/div/div/ul/li[" + str(i) + "]/a/@href")[0] if("/genre/tag/" in tagurl): if(tagstring not in taglist): taglist.append(tagstring) else: if(tagstring not in genrelist): genrelist.append(tagstring)

It correctly now puts genres to genres and tags to tags, no mixup any more.

But careful: "hentai tags" have again a different URL pattern and will not be recognized as tags now, but as genres. My python knowledge is too limited so far to resolve that on my own, but since I don't have hentai stuff in my personal collection, I didn't have to care much about it.

Sorry for not issuing a pull request - I am not used to work with github so far, so I preferred to contribute this way instead.