-
Notifications
You must be signed in to change notification settings - Fork 88
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
make tag browsing case-insensitive and unique #1807
base: master
Are you sure you want to change the base?
Conversation
if multiple_tags: | ||
multiple_tags = multiple_tags.split('/') | ||
else: | ||
multiple_tags = [] | ||
multiple_tags = sorted([x for x in multiple_tags if x]) | ||
#Make all tags lower-cased and unique to get a case-insensitive search filter and shortened browse url | ||
multiple_tags = sorted(set([x.lower() for x in multiple_tags if x])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to for the list comprehension if we turn it into a set anyways
multiple_tags = sorted(set([x.lower() for x in multiple_tags if x])) | |
multiple_tags = sorted({x.lower() for x in multiple_tags if x}) |
@@ -152,7 +152,7 @@ def search_view_helper(request): | |||
'tags_mode': sqp.tags_mode_active(), | |||
'query_time': results.q_time | |||
})) | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit pick: Consider setting your editor to trim all trailing whitespace automatically or use a code formatter
I think it's still possible to add both lower-case and upper-case tags when uploading a Sound or when changing a sounds description. |
Issue(s)
#1312
Description
In the
tag
view, make the multiple_tags list elements to be lowercased and unique, in order to get a proper search_filterNote: I do not really understand why uppercase tags exist, other than by directly writing them into the url I have not found a way to use them in the Freesound website. However I guess this is still useful.