diff options
author | benadha <benawiadha@gmail.com> | 2022-01-15 15:28:37 +0700 |
---|---|---|
committer | benadha <benawiadha@gmail.com> | 2022-01-15 15:28:37 +0700 |
commit | 2938aa17a2a484311be07456f47ea8453b57c28a (patch) | |
tree | 8f37d9b6ffb0b8c5d097c11c5f8f68a61a6ae511 | |
parent | 163cf5f1d099faec8f36f6fb979eb947582f44e4 (diff) | |
download | epy-2938aa17a2a484311be07456f47ea8453b57c28a.tar.gz |
More explicit 'content_path'
-rwxr-xr-x | epy.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -3075,7 +3075,6 @@ class Reader: reading_state = self.convert_relative_reading_state_to_absolute(reading_state) else: text_structure, toc_entries, contents = self.get_current_book_content(reading_state) - content_path = contents[reading_state.content_index] totlines = len(text_structure.text_lines) @@ -3516,16 +3515,19 @@ class Reader: if isinstance(self.ebook, (Epub, Mobi, Azw)): # self.seamless adjustment if self.seamless: - content_path = self.ebook.contents[ + current_content_index = ( self.convert_absolute_reading_state_to_relative( reading_state ).content_index - ] + ) + else: + current_content_index = reading_state.content_index # for n, content in enumerate(self.ebook.contents): # content_path = content # if reading_state.row < sum(totlines_per_content[:n]): # break + content_path = self.ebook.contents[current_content_index] assert isinstance(content_path, str) image_path = resolve_path(content_path, image_path) imgnm, imgbstr = self.ebook.get_img_bytestr(image_path) |