Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve HDoujin info.txt parsing #1053

Merged
merged 4 commits into from
Aug 18, 2024
Merged

Improve HDoujin info.txt parsing #1053

merged 4 commits into from
Aug 18, 2024

Conversation

HDoujinDownloader
Copy link
Contributor

Currently, tags are only extracted from the TAGS field for HDoujin's info.txt files. I've updated the plugin to extract tags from other fields as well (artist, series, language, parody, etc.), and namespace them accordingly.

Parse tags from additional fields
Copy link
Owner

@Difegue Difegue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall - I think the tests should be updated to reflect the new summary/description parsing here. Thanks!

lib/LANraragi/Plugin/Metadata/Hdoujin.pm Outdated Show resolved Hide resolved
lib/LANraragi/Plugin/Metadata/Hdoujin.pm Outdated Show resolved Hide resolved
lib/LANraragi/Plugin/Metadata/Hdoujin.pm Outdated Show resolved Hide resolved
Filter out irrelevant fields and support more JSON configurations
@HDoujinDownloader
Copy link
Contributor Author

Thank you for the feedback!

I updated the JSON parser to read the summary and make it more consistent with the output from the TXT file parser. It was adding all the fields as tags (including titles and URLs), but I've limited it to a more relevant subset. I also updated it to work with different JSON configurations (the outer manga_info may or may not be present based on user settings). The namespace-related issues should be resolved now as well.

I think the tests should be updated to reflect the new summary/description parsing here

Correct me if I'm wrong, but it doesn't look like there are any tests for this format right now. I could possibly add some.

@Difegue
Copy link
Owner

Difegue commented Aug 18, 2024

Thanks! The JSON parser was a pretty old bit of code so I'm not surprised if it was worse than the txt version.
There are indeed no specific tests for the HDoujin plugin - Adding some with samples like the other plugins have would be welcome, but that's not blocking me from merging this in the meantime.

@Difegue Difegue merged commit abf1ec5 into Difegue:dev Aug 18, 2024
1 check passed
Copy link

holopin-bot bot commented Aug 18, 2024

Congratulations @HDoujinDownloader, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cm0063ggy18850clbr48u3ufu

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

@Boontato
Copy link

I updated the JSON parser to read the summary and make it more consistent with the output from the TXT file parser. It was adding all the fields as tags (including titles and URLs), but I've limited it to a more relevant subset. I also updated it to work with different JSON configurations (the outer manga_info may or may not be present based on user settings). The namespace-related issues should be resolved now as well.

Thanks squiddy for working on this, I actually enjoyed that it would pull URLs since in mihon/tachi i could search nhentai codes and it would resolve because the url is part of the tags and it was useful at least for me.

when i saw this PR i was hoping that it would fix the ability for this plugin to pull the title too because right now im using a secondary plugin just to pull title information from the metadata file.

@HDoujinDownloader
Copy link
Contributor Author

@Boontato Oh! I didn't even notice plugins could specify a gallery title. I'll get that fixed and submit a new PR in a bit.

@Difegue What's your take on having URLs in the tags (e.g. url:https://nhentai.net/g/XXXXXX/)? If the use case is just being able to search by NHentai code, maybe there's a better way to do it.

@Difegue
Copy link
Owner

Difegue commented Aug 31, 2024

You should use source:nhentai.net/xxxx tags if you want to add URLs to the metadata, there's support for those in the browser extension and a few other spots.

@Boontato
Copy link

Yes I have been using tag rules to convert url namespace to source namespaces. mihon also allowed specifying which namespace to use to pull the url too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants