[scrobbles] Auto set playback seconds
This commit is contained in:
@ -702,6 +702,9 @@ class Scrobble(TimeStampedModel):
|
||||
if self.media_obj:
|
||||
self.media_type = self.MediaType(self.media_obj.__class__.__name__)
|
||||
|
||||
if (self.timestamp and self.stop_timestamp) and (not self.playback_position_seconds or self.playback_position_seconds <= 0):
|
||||
self.playback_position_seconds = (self.stop_timestamp - self.timestamp).seconds
|
||||
|
||||
return super(Scrobble, self).save(*args, **kwargs)
|
||||
|
||||
def get_absolute_url(self):
|
||||
|
||||
Reference in New Issue
Block a user