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.34k stars 152 forks source link

Trim downloader queries #370

Open imtbl opened 4 years ago

imtbl commented 4 years ago

As reported by a user in Discord, Hydrus currently doesn't seem to trim downloader queries (at least for subscriptions, probably elsewhere too). This can lead to confusing behavior especially if the users copy/pastes a query and doesn't check for trailing whitespace.

Example screenshot provided by the user: image

bbappserver commented 4 years ago

NB, in python string trimming is done with a method called strip() https://docs.python.org/3.8/library/stdtypes.html#str.strip

imtbl commented 4 years ago

Users on the Discord have argued that there might be edge cases where having the ability to keep leading/trailing whitespace might be required. So the ability to trim should probably be rather a setting as to not break existing workflows.

Zweibach commented 4 years ago

At least make trim default on new queries then. Changing existing ones I can agree might break something, but considering it's most probably a very edge-case to not trim whitespace I see no reason to not trim by default.