Add Twitch directory URL property to Game model and update dashboard to handle channel display logic
This commit is contained in:
parent
fc52a94284
commit
c8cc6d83df
2 changed files with 44 additions and 24 deletions
|
|
@ -172,6 +172,13 @@ class Game(models.Model):
|
|||
return self.slug
|
||||
return self.id
|
||||
|
||||
@property
|
||||
def twitch_directory_url(self) -> str:
|
||||
"""Return the Twitch directory URL for this game with drops filter if slug is available."""
|
||||
if self.slug:
|
||||
return f"https://www.twitch.tv/directory/category/{self.slug}?filter=drops"
|
||||
return ""
|
||||
|
||||
|
||||
class Channel(models.Model):
|
||||
"""Represents a Twitch channel that can participate in drop campaigns."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue