Only show DropCampaignDetails

This commit is contained in:
Joakim Hellsén 2026-01-09 21:35:47 +01:00
commit 026bc57f77
No known key found for this signature in database
2 changed files with 32 additions and 9 deletions

View file

@ -467,7 +467,12 @@ class DropCampaignFeed(Feed):
def items(self) -> list[DropCampaign]:
"""Return the latest 100 drop campaigns."""
return list(DropCampaign.objects.select_related("game").order_by("-added_at")[:100])
return list(
DropCampaign.objects
.filter(operation_name="DropCampaignDetails")
.select_related("game")
.order_by("-added_at")[:100],
)
def item_title(self, item: Model) -> SafeText:
"""Return the campaign name as the item title (SafeText for RSS)."""
@ -609,7 +614,12 @@ class GameCampaignFeed(Feed):
def items(self, obj: Game) -> list[DropCampaign]:
"""Return the latest 100 drop campaigns for this game, ordered by most recently added."""
return list(DropCampaign.objects.filter(game=obj).select_related("game").order_by("-added_at")[:100])
return list(
DropCampaign.objects
.filter(game=obj, operation_name="DropCampaignDetails")
.select_related("game")
.order_by("-added_at")[:100],
)
# MARK: /rss/organizations/<twitch_id>/campaigns/
@ -642,7 +652,12 @@ class OrganizationCampaignFeed(Feed):
def items(self, obj: Organization) -> list[DropCampaign]:
"""Return the latest 100 drop campaigns for this organization, ordered by most recently added."""
return list(DropCampaign.objects.filter(game__owner=obj).select_related("game").order_by("-added_at")[:100])
return list(
DropCampaign.objects
.filter(game__owner=obj, operation_name="DropCampaignDetails")
.select_related("game")
.order_by("-added_at")[:100],
)
def item_author_name(self, item: DropCampaign) -> str:
"""Return the author name for the campaign, typically the game name."""