Add templates and clean up views for scrobbling
Biggest thing here is adding the ability to scrobble until the video is 95% done and then not scrobble the same video file again for 15 minutes. This seems hacky, but in practice works pretty well, so long as you don't monkey around with the 95% completion thing. Unlike music, videos are generally watched all the way through.
This commit is contained in:
@ -20,6 +20,13 @@ class Scrobble(TimeStampedModel):
|
||||
played_to_completion = models.BooleanField(default=False)
|
||||
source = models.CharField(max_length=255, **BNULL)
|
||||
source_id = models.TextField(**BNULL)
|
||||
in_progress = models.BooleanField(default=True)
|
||||
|
||||
def percent_played(self):
|
||||
return int((self.playback_position_ticks / video.run_time_ticks) * 100)
|
||||
@property
|
||||
def percent_played(self) -> int:
|
||||
return int(
|
||||
(self.playback_position_ticks / self.video.run_time_ticks) * 100
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return f"Scrobble of {self.video} {self.timestamp.year}-{self.timestamp.month}"
|
||||
|
||||
Reference in New Issue
Block a user