Exclude media from sources without ContentSource
record from search
#4076
Labels
💻 aspect: code
Concerns the software code in the repository
🛠 goal: fix
Bug fix
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: api
Related to the Django API
Problem
When we add a new provider, we don't immediately add a
ContentSource
record to the API. This means that the media is immediately available in search results.Description
When building an excluded source query, we should add the sources that don't have a
ContentSource
model to the excluded sources. To do that, we can get all sources using:openverse/api/api/controllers/search_controller.py
Line 549 in a71cab6
This is where the query is built:
openverse/api/api/controllers/search_controller.py
Lines 178 to 184 in a71cab6
Alternatives
An alternative would be to add a step to the data refresh that would add new
ContentSource
records for all the sources that were added during the data refresh: #3548Additional context
#2487 is related in that it added a filter for the single results: if "Hide content" for their provider is set to
True
, the result is not returned.The text was updated successfully, but these errors were encountered: