[scrobbling] Sometimes we wont have timestamps

This commit is contained in:
2024-02-12 12:11:07 -05:00
parent 2c08336e33
commit 0bbd488f0d
2 changed files with 4 additions and 2 deletions

View File

@ -558,7 +558,8 @@ class Scrobble(TimeStampedModel):
self.uuid = uuid4()
# Microseconds mess up Django's filtering, and we don't need be that specific
self.timestamp = self.timestamp.replace(microsecond=0)
if self.timestamp:
self.timestamp = self.timestamp.replace(microsecond=0)
self.media_type = self.MediaType(self.media_obj.__class__.__name__)
return super(Scrobble, self).save(*args, **kwargs)