From 3a83e754014bb4661242c96a57614eae3f485aa1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Apr 2022 17:15:12 +0530 Subject: [PATCH] Fix viewing LRF files not working. Fixes #1970391 [LRF books cannot be viewed](https://bugs.launchpad.net/calibre/+bug/1970391) --- src/calibre/gui2/actions/view.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/actions/view.py b/src/calibre/gui2/actions/view.py index 88ce823a43..376ca6eebc 100644 --- a/src/calibre/gui2/actions/view.py +++ b/src/calibre/gui2/actions/view.py @@ -168,12 +168,13 @@ class ViewAction(InterfaceAction): if name is not None: args.append(name) - if open_at is not None: - args.append('--open-at=' + open_at) - if calibre_book_data is not None: - with PersistentTemporaryFile('.json') as ptf: - ptf.write(as_bytes(json.dumps(calibre_book_data))) - args.append('--internal-book-data=' + ptf.name) + if viewer != 'lrfviewer': + if open_at is not None: + args.append('--open-at=' + open_at) + if calibre_book_data is not None: + with PersistentTemporaryFile('.json') as ptf: + ptf.write(as_bytes(json.dumps(calibre_book_data))) + args.append('--internal-book-data=' + ptf.name) self.gui.job_manager.launch_gui_app(viewer, kwargs=dict(args=args)) else: