+ def save(self, *args, **kwargs):
+ # TODO: placeholder.
+ try:
+ audio_l = self.book.get_audio_length()
+ except:
+ audio_l = 60
+ if self.anchor:
+ self.mode = 'text'
+ if audio_l:
+ self.audio_timestamp = audio_l * .4
+ if self.audio_timestamp:
+ self.mode = 'audio'
+ if self.audio_timestamp > audio_l:
+ self.audio_timestamp = audio_l
+ if audio_l:
+ self.anchor = 'f20'
+ return super().save(*args, **kwargs)
+