add small comment

This commit is contained in:
Markos Gogoulos 2020-12-25 15:07:50 +02:00
parent 9339443ddf
commit 47936b8be7
2 changed files with 7 additions and 1 deletions

View file

@ -117,6 +117,7 @@ class SearchRSSFeed(Feed):
elif tag:
media = media.filter(tags__title=tag)
elif query:
# same as on files.views.MediaSearch: move this processing to a prepare_query function
query = helpers.clean_query(query)
q_parts = [
q_part.strip("y")

View file

@ -732,8 +732,13 @@ class MediaSearch(APIView):
media = Media.objects.filter(state="public", is_reviewed=True)
if query:
# move this processing to a prepare_query function
query = clean_query(query)
q_parts = [q_part for q_part in query.split() if q_part not in STOP_WORDS]
q_parts = [
q_part.strip("y")
for q_part in query.split()
if q_part not in STOP_WORDS
]
if q_parts:
query = SearchQuery(q_parts[0] + ":*", search_type="raw")
for part in q_parts[1:]: