X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/32e632734c0a8390775bb8661edc78c2045cf5f3..d08ac1730868531e81bf918e0362935e988428ca:/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