Fixed a bug that would cause no playback on newloy loaded books. Added .mobi support.
This commit is contained in:
@@ -35,6 +35,7 @@ from src.daisy_parser import DaisyParser
|
||||
from src.epub_parser import EpubParser
|
||||
from src.pdf_parser import PdfParser
|
||||
from src.txt_parser import TxtParser
|
||||
from src.mobi_parser import MobiParser
|
||||
from src.audio_parser import AudioParser
|
||||
from src.folder_audiobook_parser import FolderAudiobookParser
|
||||
from src.bookmark_manager import BookmarkManager
|
||||
@@ -122,7 +123,7 @@ class BookReader:
|
||||
booksDir = libraryDir
|
||||
else:
|
||||
booksDir = self.config.get_books_directory()
|
||||
supportedFormats = ['.zip', '.epub', '.pdf', '.txt', '.m4b', '.m4a', '.mp3']
|
||||
supportedFormats = ['.zip', '.epub', '.mobi', '.pdf', '.txt', '.m4b', '.m4a', '.mp3']
|
||||
self.bookSelector = BookSelector(booksDir, supportedFormats, self.speechEngine)
|
||||
|
||||
# Initialize sleep timer menu
|
||||
@@ -220,6 +221,9 @@ class BookReader:
|
||||
if suffix in ['.epub']:
|
||||
self.parser = EpubParser()
|
||||
self.book = self.parser.parse(self.bookPath)
|
||||
elif suffix in ['.mobi']:
|
||||
self.parser = MobiParser()
|
||||
self.book = self.parser.parse(self.bookPath)
|
||||
elif suffix in ['.zip']:
|
||||
# Assume DAISY format for zip files
|
||||
self.parser = DaisyParser()
|
||||
|
||||
Reference in New Issue
Block a user