Exclude media from sources without ContentProvider
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
ContentProvider
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
ContentProvider
model to the excluded sources. To do that, we can get all sources using:openverse/api/api/controllers/search_controller.py
Line 549 in d377c69
This is where the query is built:
openverse/api/api/controllers/search_controller.py
Lines 188 to 193 in d377c69
Alternatives
An alternative would be to add a step to the data refresh that would add new
ContentProvider
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: