[videos] Add preliminary Twitch video support
This commit is contained in:
@ -397,6 +397,7 @@ class Scrobble(TimeStampedModel):
|
||||
LIFE_EVENT = "LifeEvent", "Life event"
|
||||
MOOD = "Mood", "Mood"
|
||||
BRICKSET = "BrickSet", "Brick set"
|
||||
CHANNEL = "Channel", "Channel"
|
||||
|
||||
@classmethod
|
||||
def list(cls):
|
||||
@ -404,6 +405,7 @@ class Scrobble(TimeStampedModel):
|
||||
|
||||
uuid = models.UUIDField(editable=False, **BNULL)
|
||||
video = models.ForeignKey(Video, on_delete=models.DO_NOTHING, **BNULL)
|
||||
channel = models.ForeignKey("videos.Channel", on_delete=models.DO_NOTHING, **BNULL)
|
||||
track = models.ForeignKey(Track, on_delete=models.DO_NOTHING, **BNULL)
|
||||
podcast_episode = models.ForeignKey(
|
||||
PodcastEpisode, on_delete=models.DO_NOTHING, **BNULL
|
||||
@ -961,6 +963,8 @@ class Scrobble(TimeStampedModel):
|
||||
media_obj = self.task
|
||||
if self.food:
|
||||
media_obj = self.food
|
||||
if self.channel:
|
||||
media_obj = self.channel
|
||||
return media_obj
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user