hydrusnetwork / hydrus

A personal booru-style media tagger that can import files and tags from your hard drive and popular websites. Content can be shared with other users via user-run servers.
http://hydrusnetwork.github.io/hydrus/
Other
2.39k stars 158 forks source link

new string cleaner that uses currently supported mime's #926

Open CuddleBear92 opened 3 years ago

CuddleBear92 commented 3 years ago

Think there should be a simple way to remove an extension from a string like a filename for all supported mimes. This way parser creators does not need to manually list all the extensions and maybe miss one, also would not need to update it if a mime is added to Hydrus.

This is prob only useful for filename tag parsing and pulling hash values from the filename more easily.

currently you can make a list like: .(jpg|jpeg|png|gif.....)and that is well and good, but keeping that updated for every content parser and not forgetting anything makes it a pain. an automated system that can just lists all the supported ones would be wanted.

hydrusnetwork commented 3 years ago

Thank you, this sounds reasonable. I can make a custom string converter rule that is basically applying a regex of the current extensions.