X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f5743451874346b0dcca3fc18f767ef1d153e84d..d2a9ebf1eae1ee5fa8a09a7dfea76995274f7716:/src/bookmarks/models.py diff --git a/src/bookmarks/models.py b/src/bookmarks/models.py index 8747ffbd3..7325e2d32 100644 --- a/src/bookmarks/models.py +++ b/src/bookmarks/models.py @@ -34,16 +34,13 @@ class Bookmark(Syncable, models.Model): 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 + self.audio_timestamp = self.book.sync_elid(self.anchor) if self.audio_timestamp: self.mode = 'audio' - if self.audio_timestamp > audio_l: - self.audio_timestamp = audio_l - if audio_l: - self.anchor = 'f20' + self.anchor = self.book.sync_ts(self.audio_timestamp) return super().save(*args, **kwargs) @classmethod