mihonapp / mihon

Free and open source manga reader for Android
Apache License 2.0
8.13k stars 331 forks source link

Allow extensions to read NSFW state #739

Open binyaminyblatt opened 2 months ago

binyaminyblatt commented 2 months ago

Describe your suggested feature

Hey I apologize if somebody has requested this before I don't know how to describe it well enough to search for it so apologies if I'm repeating something

The future request I'm looking for is to allow a third option for is NSFW which would be it might be partially NSFW but it could read the switch in the app that disables NSFW extensions and then it would if possible in the extension set all the settings for the extension to disable the NSFW parts for instance redacted source name has the ability to just disable the NSFW parts and if it could read in the settings from the app itself it could then say these settings should never be allowed to be enabled and just hide them and hard code the values

As a good example redacted source name has four categories and it would disable the NSFW categories and lock that setting as disabled so it could be used in an sfw mode now obviously this wouldn't work for every extension because some of them just don't have that capability

Basically what I'm saying that when it tries to load up the class that is the extension the app could pass a parameter that is the current value of whether or not and if NSFW is allowed on this device and then based upon that a couple of if statements should be able to decide whether or not certain things are viewable or not

Obviously this would require some restructuring of how repositories work but I don't think it should be that complicated to implement I'm not a Java developer but I work in Python and other languages and I could see this being done fairly easily

Other details

No response

Acknowledgements

AntsyLich commented 2 months ago

This is quite doable. Will keep in mind when we get around to redoing the source api

binyaminyblatt commented 2 months ago

Thanks 👍

I always felt bad though probably the best source (redacted source name) was out of reach because I refuse to enable nsfw sources

MajorTanya commented 2 months ago

Avoid naming sources please

binyaminyblatt commented 2 months ago

Avoid naming sources please

Would you like me to edit it I just left it that way so the example is easily understood

MajorTanya commented 2 months ago

Avoid naming sources please

Would you like me to edit it I just left it that way so the example is easily understood

Would be best if you did, but I understand how it is useful for the example. Just remember it for the next time you file an issue 👍

binyaminyblatt commented 2 months ago

Avoid naming sources please

Would you like me to edit it I just left it that way so the example is easily understood

Would be best if you did, but I understand how it is useful for the example. Just remember it for the next time you file an issue 👍

How is that if you can describe it better so that I don't need examples like that I'd be happy to rewrite it anyway that makes sense