Skip to content

Commit

Permalink
refactor: optimize recommended query
Browse files Browse the repository at this point in the history
  • Loading branch information
danjac committed Jan 20, 2025
1 parent c6ae53d commit 397b8e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion radiofeed/podcasts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def recommended(self, user: User) -> models.QuerySet["Podcast"]:
# pick highest matches
# we want the sum of the relevance of the recommendations, grouped by recommended

subscribed = user.subscriptions.values("podcast")
subscribed = set(user.subscriptions.values_list("podcast", flat=True))

scores = (
Recommendation.objects.filter(
Expand Down

0 comments on commit 397b8e4

Please sign in to comment.