diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 9ad76a99f..ab20b4996 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -333,7 +333,7 @@ class MessageListener(object): # the conversion has already been done at this point. file_type = file_path.suffix.lower()[1:] if file_type in PDF_CONTROLLER_FILETYPES: - log.debug('Converting from pdf/xps/oxps to images for serviceitem with file {name}'.format(name=file_path)) + log.debug('Converting from pdf/xps/oxps/epub/cbz/fb2 to images for serviceitem with file {name}'.format(name=file_path)) # Create a copy of the original item, and then clear the original item so it can be filled with images item_cpy = copy.copy(item) item.__init__(None) diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index b58d8df4c..57a1494ca 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -42,7 +42,7 @@ except ImportError: log = logging.getLogger(__name__) -PDF_CONTROLLER_FILETYPES = ['pdf', 'xps', 'oxps'] +PDF_CONTROLLER_FILETYPES = ['pdf', 'xps', 'oxps', 'epub', 'cbz', 'fb2'] class PdfController(PresentationController): @@ -128,7 +128,7 @@ class PdfController(PresentationController): elif program_type == 'mutool': self.mutoolbin = program_path elif PYMUPDF_AVAILABLE: - self.also_supports = ['xps', 'oxps'] + self.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2'] return True else: # Fallback to autodetection @@ -156,7 +156,7 @@ class PdfController(PresentationController): elif (application_path / 'mutool').is_file(): self.mutoolbin = application_path / 'mutool' if self.mudrawbin or self.mutoolbin: - self.also_supports = ['xps', 'oxps'] + self.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2'] return True elif self.gsbin: return True diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index 730cf7e0b..4ea625f08 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -65,7 +65,7 @@ class TestMediaItem(TestCase, TestMixin): pdf_controller = MagicMock() pdf_controller.enabled.return_value = True pdf_controller.supports = ['pdf'] - pdf_controller.also_supports = ['xps', 'oxps'] + pdf_controller.also_supports = ['xps', 'oxps', 'epub', 'cbz', 'fb2'] # Mock the controllers. self.media_item.controllers = { 'Impress': impress_controller, @@ -85,6 +85,9 @@ class TestMediaItem(TestCase, TestMixin): assert '*.pdf' in self.media_item.on_new_file_masks, 'The file mask should contain the pdf extension' assert '*.xps' in self.media_item.on_new_file_masks, 'The file mask should contain the xps extension' assert '*.oxps' in self.media_item.on_new_file_masks, 'The file mask should contain the oxps extension' + assert '*.epub' in self.media_item.on_new_file_masks, 'The file mask should contain the epub extension' + assert '*.cbz' in self.media_item.on_new_file_masks, 'The file mask should contain the cbz extension' + assert '*.fb2' in self.media_item.on_new_file_masks, 'The file mask should contain the fb2 extension' def test_clean_up_thumbnails(self): """