Enhance RSS feed for drop campaigns
This commit is contained in:
parent
51ec52499f
commit
5c3795d4a4
2 changed files with 86 additions and 5 deletions
|
|
@ -161,6 +161,17 @@ class Game(models.Model):
|
|||
)
|
||||
return urlunsplit((parts.scheme, parts.netloc, path, "", ""))
|
||||
|
||||
@property
|
||||
def get_game_name(self) -> str:
|
||||
"""Return the best available name for the game."""
|
||||
if self.display_name:
|
||||
return self.display_name
|
||||
if self.name:
|
||||
return self.name
|
||||
if self.slug:
|
||||
return self.slug
|
||||
return self.id
|
||||
|
||||
|
||||
class DropCampaign(models.Model):
|
||||
"""Represents a Twitch drop campaign."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue